├── .build.sh ├── .gitignore ├── CMakeLists.txt ├── LICENSE ├── README ├── VERSION ├── bempp_setup.cfg.template ├── bempp_setup.py ├── cmake ├── BemppConfig.cmake.in ├── BemppConfigLocation.in ├── BemppFindDependencies.cmake ├── BemppOptions.cmake ├── DUNE-COPYING-CMAKE-SCRIPTS ├── DuneUtils.cmake ├── FindNumpy.cmake ├── FindOPENCL.cmake └── FindSphinx.cmake ├── cmake_uninstall.cmake.in ├── contrib └── dune │ ├── LICENSE │ └── dune-foamgrid │ ├── .gitignore │ ├── COPYING │ ├── Makefile.am │ ├── README │ ├── configure.ac │ ├── doc │ ├── Makefile.am │ └── doxygen │ │ ├── Doxylocal │ │ └── Makefile.am │ ├── dune-foamgrid.pc.in │ ├── dune.module │ ├── dune │ ├── Makefile.am │ └── foamgrid │ │ ├── Makefile.am │ │ ├── foamgrid.hh │ │ ├── foamgrid │ │ ├── Makefile.am │ │ ├── foamgridedge.hh │ │ ├── foamgridelements.hh │ │ ├── foamgridentity.hh │ │ ├── foamgridentitypointer.hh │ │ ├── foamgridfactory.hh │ │ ├── foamgridgeometry.hh │ │ ├── foamgridhierarchiciterator.hh │ │ ├── foamgridindexsets.hh │ │ ├── foamgridintersectioniterators.hh │ │ ├── foamgridintersections.hh │ │ ├── foamgridleafiterator.hh │ │ ├── foamgridleveliterator.hh │ │ └── foamgridvertex.hh │ │ └── test │ │ ├── Makefile.am │ │ └── foamgrid-test.cc │ ├── m4 │ ├── Makefile.am │ └── dune-foamgrid.m4 │ ├── src │ ├── Makefile.am │ └── dune_foamgrid.cc │ └── stamp-vc ├── doc └── misc │ ├── CMakeLists.txt.example │ └── README.complex.txt ├── examples ├── CMakeLists.txt ├── meshes │ ├── cube-h-0.00625.msh │ ├── cube-h-0.0125.msh │ ├── cube-h-0.025.msh │ ├── cube-h-0.05.msh │ ├── cube-h-0.1.msh │ ├── cube.geo │ ├── sphere-h-0.025.msh │ ├── sphere-h-0.05.msh │ ├── sphere-h-0.1.msh │ ├── sphere-h-0.2.msh │ ├── sphere-h-0.4.msh │ ├── sphere.geo │ └── sphere.txt └── tutorial_dirichlet.cpp ├── installer ├── build_scripts │ └── posix │ │ ├── ahmed_build.sh │ │ ├── boost_build.sh │ │ ├── dune_build.sh │ │ └── trilinos_build.sh ├── patches │ ├── BoostTesting.patch │ ├── Teuchos_LAPACK.cpp.patch │ ├── Teuchos_LAPACK.hpp.patch │ ├── Thyra_BelosLinearOpWithSolve_def.patch │ ├── ahmed_ACAn_inext_jnext_ACA.h.patch │ ├── ahmed_addGeHGeH_single_precision.patch │ ├── ahmed_blas.patch │ ├── ahmed_check_error_apprx.h.patch │ ├── ahmed_cmake.patch │ ├── ahmed_debug_messages_ACA.h.patch │ ├── ahmed_debug_messages_apprx.h.patch │ ├── ahmed_frobenius_norm_ACA.h.patch │ ├── ahmed_generic_aca_apprx.h.patch │ ├── ahmed_pass_clusters_to_aca_matgen_ACA.h.patch │ ├── ahmed_pass_clusters_to_aca_matgen_apprx.h.patch │ ├── ahmed_permuted_indices_bemcluster.h.patch │ ├── ahmed_retry_if_zero_and_orig_cross_ACA.h.patch │ ├── ahmed_total_pivot_count_apprx.h.patch │ ├── ahmed_zero_pu_pv_ACA.h.patch │ ├── armadillo_config.patch │ ├── cmake │ │ ├── dune-common.cmake │ │ ├── dune-foamgrid.cmake │ │ ├── dune-grid.cmake │ │ └── dune-localfunctions.cmake │ ├── dune-foamgrid │ │ ├── foamgrid-comm.patch │ │ ├── foamgrid-setindices.patch │ │ ├── foamgridentityimp-assignment-operator.patch │ │ └── foamgridfactory-insertboundarysegment.patch │ ├── dune-grid.patch │ ├── dune-localfunctions_raviartthomas.patch │ ├── thyra_static_initialization_order.patch │ └── trilinos_find_python_interp.patch └── py_modules │ ├── __init__.py │ ├── ahmed.py │ ├── armadillo.py │ ├── bempp.py │ ├── boost.py │ ├── cmake.py │ ├── configuration.py │ ├── dune.py │ ├── mkl.py │ ├── python_patch.py │ ├── swig.py │ ├── tbb.py │ ├── tools.py │ ├── trilinos.py │ └── urlgrabber │ ├── LICENSE │ ├── __init__.py │ ├── byterange.py │ ├── grabber.py │ ├── keepalive.py │ ├── mirror.py │ ├── progress.py │ └── sslfactory.py ├── lib ├── CMakeLists.txt ├── Doxyfile.in ├── assembly │ ├── abstract_boundary_operator.cpp │ ├── abstract_boundary_operator.hpp │ ├── abstract_boundary_operator_composition.cpp │ ├── abstract_boundary_operator_composition.hpp │ ├── abstract_boundary_operator_id.hpp │ ├── abstract_boundary_operator_pseudoinverse.cpp │ ├── abstract_boundary_operator_pseudoinverse.hpp │ ├── abstract_boundary_operator_sum.cpp │ ├── abstract_boundary_operator_sum.hpp │ ├── abstract_boundary_operator_superposition_base.cpp │ ├── abstract_boundary_operator_superposition_base.hpp │ ├── aca_approximate_lu_inverse.cpp │ ├── aca_approximate_lu_inverse.hpp │ ├── aca_global_assembler.cpp │ ├── aca_global_assembler.hpp │ ├── aca_options.cpp │ ├── aca_options.hpp │ ├── adjoint_abstract_boundary_operator.cpp │ ├── adjoint_abstract_boundary_operator.hpp │ ├── ahmed_aux.hpp │ ├── ahmed_aux_fwd.hpp │ ├── ahmed_complex.hpp │ ├── ahmed_leaf_cluster_array.cpp │ ├── ahmed_leaf_cluster_array.hpp │ ├── ahmed_mblock_array_deleter.cpp │ ├── ahmed_mblock_array_deleter.hpp │ ├── assembled_potential_operator.cpp │ ├── assembled_potential_operator.hpp │ ├── assembly_options.cpp │ ├── assembly_options.hpp │ ├── blocked_boundary_operator.cpp │ ├── blocked_boundary_operator.hpp │ ├── blocked_operator_structure.cpp │ ├── blocked_operator_structure.hpp │ ├── boundary_operator.cpp │ ├── boundary_operator.hpp │ ├── cluster_construction_helper.cpp │ ├── cluster_construction_helper.hpp │ ├── complexified_discrete_boundary_operator.cpp │ ├── complexified_discrete_boundary_operator.hpp │ ├── component_lists_cache.cpp │ ├── component_lists_cache.hpp │ ├── context.cpp │ ├── context.hpp │ ├── discrete_aca_boundary_operator.cpp │ ├── discrete_aca_boundary_operator.cpp.with_omp_matvec │ ├── discrete_aca_boundary_operator.hpp │ ├── discrete_blocked_boundary_operator.cpp │ ├── discrete_blocked_boundary_operator.hpp │ ├── discrete_boundary_operator.cpp │ ├── discrete_boundary_operator.hpp │ ├── discrete_boundary_operator_cache.cpp │ ├── discrete_boundary_operator_cache.hpp │ ├── discrete_boundary_operator_composition.cpp │ ├── discrete_boundary_operator_composition.hpp │ ├── discrete_boundary_operator_sum.cpp │ ├── discrete_boundary_operator_sum.hpp │ ├── discrete_dense_boundary_operator.cpp │ ├── discrete_dense_boundary_operator.hpp │ ├── discrete_inverse_sparse_boundary_operator.cpp │ ├── discrete_inverse_sparse_boundary_operator.hpp │ ├── discrete_null_boundary_operator.cpp │ ├── discrete_null_boundary_operator.hpp │ ├── discrete_sparse_boundary_operator.cpp │ ├── discrete_sparse_boundary_operator.hpp │ ├── elementary_abstract_boundary_operator.cpp │ ├── elementary_abstract_boundary_operator.hpp │ ├── elementary_integral_operator.cpp │ ├── elementary_integral_operator.hpp │ ├── elementary_local_operator.cpp │ ├── elementary_local_operator.hpp │ ├── elementary_potential_operator.cpp │ ├── elementary_potential_operator.hpp │ ├── elementary_regular_integral_operator.hpp │ ├── elementary_singular_integral_operator.hpp │ ├── evaluation_options.cpp │ ├── evaluation_options.hpp │ ├── function.hpp │ ├── general_elementary_singular_integral_operator.hpp │ ├── general_elementary_singular_integral_operator_imp.hpp │ ├── grid_function.cpp │ ├── grid_function.hpp │ ├── helmholtz_3d_adjoint_double_layer_boundary_operator.cpp │ ├── helmholtz_3d_adjoint_double_layer_boundary_operator.hpp │ ├── helmholtz_3d_boundary_operator_base.hpp │ ├── helmholtz_3d_boundary_operator_base_imp.hpp │ ├── helmholtz_3d_double_layer_boundary_operator.cpp │ ├── helmholtz_3d_double_layer_boundary_operator.hpp │ ├── helmholtz_3d_double_layer_potential_operator.cpp │ ├── helmholtz_3d_double_layer_potential_operator.hpp │ ├── helmholtz_3d_far_field_double_layer_potential_operator.cpp │ ├── helmholtz_3d_far_field_double_layer_potential_operator.hpp │ ├── helmholtz_3d_far_field_single_layer_potential_operator.cpp │ ├── helmholtz_3d_far_field_single_layer_potential_operator.hpp │ ├── helmholtz_3d_hypersingular_boundary_operator.cpp │ ├── helmholtz_3d_hypersingular_boundary_operator.hpp │ ├── helmholtz_3d_operators_common.hpp │ ├── helmholtz_3d_potential_operator_base.hpp │ ├── helmholtz_3d_potential_operator_base_imp.hpp │ ├── helmholtz_3d_single_layer_boundary_operator.cpp │ ├── helmholtz_3d_single_layer_boundary_operator.cpp.working │ ├── helmholtz_3d_single_layer_boundary_operator.hpp │ ├── helmholtz_3d_single_layer_boundary_operator.hpp.working │ ├── helmholtz_3d_single_layer_potential_operator.cpp │ ├── helmholtz_3d_single_layer_potential_operator.hpp │ ├── identity_operator.cpp │ ├── identity_operator.hpp │ ├── index_permutation.hpp │ ├── interpolated_function.cpp │ ├── interpolated_function.hpp │ ├── l2_norm.cpp │ ├── l2_norm.hpp │ ├── laplace_3d_adjoint_double_layer_boundary_operator.cpp │ ├── laplace_3d_adjoint_double_layer_boundary_operator.hpp │ ├── laplace_3d_boundary_operator_base.hpp │ ├── laplace_3d_boundary_operator_base_imp.hpp │ ├── laplace_3d_double_layer_boundary_operator.cpp │ ├── laplace_3d_double_layer_boundary_operator.hpp │ ├── laplace_3d_double_layer_potential_operator.cpp │ ├── laplace_3d_double_layer_potential_operator.hpp │ ├── laplace_3d_hypersingular_boundary_operator.cpp │ ├── laplace_3d_hypersingular_boundary_operator.hpp │ ├── laplace_3d_potential_operator_base.hpp │ ├── laplace_3d_potential_operator_base_imp.hpp │ ├── laplace_3d_single_layer_boundary_operator.cpp │ ├── laplace_3d_single_layer_boundary_operator.cpp.working │ ├── laplace_3d_single_layer_boundary_operator.hpp │ ├── laplace_3d_single_layer_boundary_operator.hpp.working │ ├── laplace_3d_single_layer_potential_operator.cpp │ ├── laplace_3d_single_layer_potential_operator.hpp │ ├── laplace_beltrami_3d_operator.cpp │ ├── laplace_beltrami_3d_operator.hpp │ ├── local_assembler_construction_helper.hpp │ ├── local_dof_lists_cache.cpp │ ├── local_dof_lists_cache.hpp │ ├── local_operator.hpp │ ├── maxwell_3d_double_layer_boundary_operator.cpp │ ├── maxwell_3d_double_layer_boundary_operator.hpp │ ├── maxwell_3d_double_layer_potential_operator.cpp │ ├── maxwell_3d_double_layer_potential_operator.hpp │ ├── maxwell_3d_far_field_double_layer_potential_operator.cpp │ ├── maxwell_3d_far_field_double_layer_potential_operator.hpp │ ├── maxwell_3d_far_field_single_layer_potential_operator.cpp │ ├── maxwell_3d_far_field_single_layer_potential_operator.hpp │ ├── maxwell_3d_identity_operator.cpp │ ├── maxwell_3d_identity_operator.hpp │ ├── maxwell_3d_single_layer_boundary_operator.cpp │ ├── maxwell_3d_single_layer_boundary_operator.hpp │ ├── maxwell_3d_single_layer_potential_operator.cpp │ ├── maxwell_3d_single_layer_potential_operator.hpp │ ├── modified_aca.hpp │ ├── modified_helmholtz_3d_adjoint_double_layer_boundary_operator.cpp │ ├── modified_helmholtz_3d_adjoint_double_layer_boundary_operator.hpp │ ├── modified_helmholtz_3d_boundary_operator_base.hpp │ ├── modified_helmholtz_3d_boundary_operator_base_imp.hpp │ ├── modified_helmholtz_3d_double_layer_boundary_operator.cpp │ ├── modified_helmholtz_3d_double_layer_boundary_operator.hpp │ ├── modified_helmholtz_3d_hypersingular_boundary_operator.cpp │ ├── modified_helmholtz_3d_hypersingular_boundary_operator.hpp │ ├── modified_helmholtz_3d_single_layer_boundary_operator.cpp │ ├── modified_helmholtz_3d_single_layer_boundary_operator.hpp │ ├── null_operator.cpp │ ├── null_operator.hpp │ ├── numerical_quadrature_strategy.cpp │ ├── numerical_quadrature_strategy.hpp │ ├── potential_operator.hpp │ ├── potential_operator_aca_assembly_helper.cpp │ ├── potential_operator_aca_assembly_helper.hpp │ ├── scaled_abstract_boundary_operator.cpp │ ├── scaled_abstract_boundary_operator.hpp │ ├── scaled_discrete_boundary_operator.cpp │ ├── scaled_discrete_boundary_operator.hpp │ ├── scattered_range.hpp │ ├── sparse_to_h_matrix_converter.cpp │ ├── sparse_to_h_matrix_converter.hpp │ ├── surface_normal_dependent_function.hpp │ ├── surface_normal_independent_function.hpp │ ├── symmetry.hpp │ ├── transposed_discrete_boundary_operator.cpp │ ├── transposed_discrete_boundary_operator.hpp │ ├── transposition_mode.hpp │ ├── vector.cpp │ ├── vector.hpp │ ├── weak_form_aca_assembly_helper.cpp │ └── weak_form_aca_assembly_helper.hpp ├── common │ ├── armadillo_fwd.hpp │ ├── auto_timer.hpp │ ├── boost_make_shared_fwd.hpp │ ├── boost_ptr_map_fwd.hpp │ ├── boost_ptr_vector_fwd.hpp │ ├── boost_scoped_array_fwd.hpp │ ├── boost_shared_array_fwd.hpp │ ├── chunk_statistics.hpp │ ├── common.hpp │ ├── complex_aux.hpp │ ├── config_ahmed.hpp.in │ ├── config_alugrid.hpp.in │ ├── config_blas_and_lapack.hpp.in │ ├── config_data_types.hpp.in │ ├── config_opencl.hpp.in │ ├── config_trilinos.hpp.in │ ├── deprecated.hpp │ ├── lazy.hpp │ ├── multidimensional_arrays.hpp │ ├── not_implemented_error.hpp │ ├── scalar_traits.hpp │ ├── shared_ptr.hpp │ ├── stl_io.hpp │ ├── to_string.hpp │ └── types.hpp ├── doxygen_main.hpp ├── fiber │ ├── CL │ │ ├── cl.hpp │ │ ├── commontypes.h │ │ ├── commontypes.h.str │ │ ├── laplace_3d_adjoint_double_layer_potential_kernel.cl │ │ ├── laplace_3d_adjoint_double_layer_potential_kernel.cl.str │ │ ├── laplace_3d_double_layer_potential_kernel.cl │ │ ├── laplace_3d_double_layer_potential_kernel.cl.str │ │ ├── laplace_3d_single_layer_potential_kernel.cl │ │ ├── laplace_3d_single_layer_potential_kernel.cl.str │ │ ├── mkclinc.sh │ │ ├── nonseparable_numerical_double_integrator.cl │ │ ├── opencl.h │ │ ├── piecewise_linear_continuous_scalar_basis.cl │ │ ├── piecewise_linear_continuous_scalar_basis.cl.str │ │ ├── scalar_function_value.cl │ │ ├── scalar_function_value.cl.str │ │ ├── separable_numerical_double_integrator.cl │ │ └── separable_numerical_double_integrator.cl.str │ ├── _2d_array.hpp │ ├── _2d_array_imp.hpp │ ├── _3d_array.hpp │ ├── _3d_array_imp.hpp │ ├── _4d_array.hpp │ ├── _4d_array_imp.hpp │ ├── accuracy_options.cpp │ ├── accuracy_options.hpp │ ├── basis.hpp │ ├── basis_data.hpp │ ├── basis_transformation_functor_wrappers.hpp │ ├── cl_util.cpp │ ├── cl_util.hpp │ ├── collection_of_2d_arrays.hpp │ ├── collection_of_2d_arrays_imp.hpp │ ├── collection_of_3d_arrays.hpp │ ├── collection_of_3d_arrays_imp.hpp │ ├── collection_of_4d_arrays.hpp │ ├── collection_of_4d_arrays_imp.hpp │ ├── collection_of_basis_transformations.hpp │ ├── collection_of_kernels.hpp │ ├── conjugate.hpp │ ├── default_collection_of_basis_transformations.hpp │ ├── default_collection_of_basis_transformations_imp.hpp │ ├── default_collection_of_kernels.hpp │ ├── default_collection_of_kernels_imp.hpp │ ├── default_evaluator_for_integral_operators.hpp │ ├── default_evaluator_for_integral_operators_imp.hpp │ ├── default_kernel_trial_integral.hpp │ ├── default_kernel_trial_integral_imp.hpp │ ├── default_local_assembler_for_grid_functions_on_surfaces.hpp │ ├── default_local_assembler_for_grid_functions_on_surfaces_imp.hpp │ ├── default_local_assembler_for_integral_operators_on_surfaces.hpp │ ├── default_local_assembler_for_integral_operators_on_surfaces_imp.hpp │ ├── default_local_assembler_for_local_operators_on_surfaces.hpp │ ├── default_local_assembler_for_local_operators_on_surfaces_imp.hpp │ ├── default_local_assembler_for_operators_on_surfaces_utilities.cpp │ ├── default_local_assembler_for_operators_on_surfaces_utilities.hpp │ ├── default_local_assembler_for_potential_operators_on_surfaces.hpp │ ├── default_local_assembler_for_potential_operators_on_surfaces_imp.hpp │ ├── default_test_kernel_trial_integral.hpp │ ├── default_test_kernel_trial_integral_imp.hpp │ ├── default_test_trial_integral.hpp │ ├── default_test_trial_integral_imp.hpp │ ├── dune_basis_helper.hpp │ ├── element_pair_topology.hpp │ ├── evaluator_for_integral_operators.hpp │ ├── explicit_instantiation.hpp │ ├── function.hpp │ ├── geometrical_data.hpp │ ├── hdiv_function_value_functor.hpp │ ├── hermite_interpolator.hpp │ ├── initialize_interpolator_for_modified_helmholtz_3d_kernels.cpp │ ├── initialize_interpolator_for_modified_helmholtz_3d_kernels.hpp │ ├── kernel_trial_integral.hpp │ ├── kernel_trial_integrator.hpp │ ├── laplace_3d_adjoint_double_layer_potential_kernel_functor.hpp │ ├── laplace_3d_double_layer_potential_kernel_functor.hpp │ ├── laplace_3d_single_layer_potential_kernel_functor.hpp │ ├── local_assembler_for_grid_functions.hpp │ ├── local_assembler_for_operators.hpp │ ├── local_assembler_for_potential_operators.hpp │ ├── maxwell_3d_test_trial_integrand_functor.hpp │ ├── modified_helmholtz_3d_adjoint_double_layer_potential_kernel_functor.hpp │ ├── modified_helmholtz_3d_adjoint_double_layer_potential_kernel_interpolated_functor.hpp │ ├── modified_helmholtz_3d_double_layer_potential_kernel_functor.hpp │ ├── modified_helmholtz_3d_double_layer_potential_kernel_interpolated_functor.hpp │ ├── modified_helmholtz_3d_far_field_double_layer_potential_kernel_functor.hpp │ ├── modified_helmholtz_3d_far_field_single_layer_potential_kernel_functor.hpp │ ├── modified_helmholtz_3d_hypersingular_integrand_functor.hpp │ ├── modified_helmholtz_3d_hypersingular_integrand_functor_2.hpp │ ├── modified_helmholtz_3d_hypersingular_kernel_functor.hpp │ ├── modified_helmholtz_3d_hypersingular_kernel_interpolated_functor.hpp │ ├── modified_helmholtz_3d_hypersingular_transformation_functor.hpp │ ├── modified_helmholtz_3d_single_layer_potential_kernel_functor.hpp │ ├── modified_helmholtz_3d_single_layer_potential_kernel_interpolated_functor.hpp │ ├── modified_maxwell_3d_double_layer_boundary_operator_integrand_functor.hpp │ ├── modified_maxwell_3d_double_layer_operators_kernel_functor.hpp │ ├── modified_maxwell_3d_double_layer_operators_kernel_interpolated_functor.hpp │ ├── modified_maxwell_3d_double_layer_potential_operator_integrand_functor.hpp │ ├── modified_maxwell_3d_far_field_double_layer_potential_operator_kernel_functor.hpp │ ├── modified_maxwell_3d_far_field_single_layer_potential_operator_kernel_functor.hpp │ ├── modified_maxwell_3d_single_layer_boundary_operator_integrand_functor.hpp │ ├── modified_maxwell_3d_single_layer_boundary_operator_kernel_functor.hpp │ ├── modified_maxwell_3d_single_layer_boundary_operator_kernel_interpolated_functor.hpp │ ├── modified_maxwell_3d_single_layer_operators_transformation_functor.hpp │ ├── modified_maxwell_3d_single_layer_potential_operator_integrand_functor.hpp │ ├── modified_maxwell_3d_single_layer_potential_operator_kernel_functor.hpp │ ├── nonseparable_numerical_test_kernel_trial_integrator.hpp │ ├── nonseparable_numerical_test_kernel_trial_integrator_imp.hpp │ ├── numerical_kernel_trial_integrator.hpp │ ├── numerical_kernel_trial_integrator_imp.hpp │ ├── numerical_quadrature.cpp │ ├── numerical_quadrature.hpp │ ├── numerical_quadrature_strategy.hpp │ ├── numerical_quadrature_strategy_imp.hpp │ ├── numerical_test_function_integrator.hpp │ ├── numerical_test_function_integrator_imp.hpp │ ├── numerical_test_trial_integrator.hpp │ ├── numerical_test_trial_integrator_imp.hpp │ ├── opencl_handler.cpp │ ├── opencl_handler.hpp │ ├── opencl_options.hpp │ ├── parallelization_options.cpp │ ├── parallelization_options.hpp │ ├── piecewise_constant_scalar_basis.hpp │ ├── piecewise_linear_continuous_scalar_basis.hpp │ ├── quadrature │ │ ├── enumerators.H │ │ ├── galerkinduffy.hpp │ │ ├── gauss1D.hpp │ │ ├── gausstensor.hpp │ │ ├── gausstria.hpp │ │ ├── macros.H │ │ ├── mat.hpp │ │ ├── numbertraits.H │ │ ├── quadrature.hpp │ │ ├── scalartraits.H │ │ ├── shapetraits.H │ │ ├── singularitytraits.H │ │ └── traits.H │ ├── quadrature_options.hpp │ ├── quadrature_strategy.hpp │ ├── raviart_thomas_0_basis.hpp │ ├── raw_grid_geometry.hpp │ ├── scalar_function_value_functor.hpp │ ├── scalar_traits.hpp │ ├── separable_numerical_test_kernel_trial_integrator.hpp │ ├── separable_numerical_test_kernel_trial_integrator_imp.hpp │ ├── serial_blas_region.cpp │ ├── serial_blas_region.hpp │ ├── shared_ptr.hpp │ ├── simple_scalar_kernel_trial_integrand_functor.hpp │ ├── simple_test_scalar_kernel_trial_integrand_functor.hpp │ ├── simple_test_trial_integrand_functor.hpp │ ├── surface_curl_3d_functor.hpp │ ├── surface_div_3d_functor.hpp │ ├── surface_grad_3d_functor.hpp │ ├── surface_normal_dependent_function.hpp │ ├── surface_normal_independent_function.hpp │ ├── test_function_integrator.hpp │ ├── test_kernel_trial_integral.hpp │ ├── test_kernel_trial_integrator.hpp │ ├── test_trial_integral.hpp │ ├── test_trial_integrator.hpp │ ├── types.hpp │ └── verbosity_level.hpp ├── grid │ ├── armadillo_helpers.hpp │ ├── concrete_element_mapper.hpp │ ├── concrete_entity.hpp │ ├── concrete_entity_decl.hpp │ ├── concrete_entity_pointer.hpp │ ├── concrete_geometry.hpp │ ├── concrete_geometry_factory.hpp │ ├── concrete_grid.hpp │ ├── concrete_grid_view.hpp │ ├── concrete_grid_view_imp.hpp │ ├── concrete_id_set.hpp │ ├── concrete_index_set.hpp │ ├── concrete_range_entity_iterator.hpp │ ├── concrete_subentity_iterator.hpp │ ├── concrete_vtk_writer.hpp │ ├── dune.hpp │ ├── entity.hpp │ ├── entity_iterator.hpp │ ├── entity_pointer.hpp │ ├── geometry.hpp │ ├── geometry_factory.hpp │ ├── geometry_imp.hpp │ ├── geometry_type.hpp │ ├── grid.cpp │ ├── grid.hpp │ ├── grid_factory.cpp │ ├── grid_factory.hpp │ ├── grid_parameters.hpp │ ├── grid_view.hpp │ ├── id_set.hpp │ ├── index_set.hpp │ ├── mapper.hpp │ ├── max_distance.cpp │ ├── max_distance.hpp │ ├── p0_vector_vtk_function.hpp │ ├── p1_vector_vtk_function.hpp │ ├── ray_triangle_intersection.cpp │ ├── ray_triangle_intersection.hpp │ ├── reverse_element_mapper.cpp │ ├── reverse_element_mapper.hpp │ ├── structured_grid_factory.hpp │ ├── vtk_writer.hpp │ ├── vtk_writer_helper.cpp │ └── vtk_writer_helper.hpp ├── linalg │ ├── belos_solver_convergence_tolerance.patch │ ├── belos_solver_wrapper.cpp │ ├── belos_solver_wrapper.hpp │ ├── belos_solver_wrapper_fwd.hpp │ ├── blocked_solution.cpp │ ├── blocked_solution.hpp │ ├── default_direct_solver.cpp │ ├── default_direct_solver.hpp │ ├── default_iterative_solver.cpp │ ├── default_iterative_solver.hpp │ ├── preconditioner.cpp │ ├── preconditioner.hpp │ ├── real_wrapper_of_complex_thyra_linear_operator.cpp │ ├── real_wrapper_of_complex_thyra_linear_operator.hpp │ ├── real_wrapper_of_complex_thyra_preconditioner.cpp │ ├── real_wrapper_of_complex_thyra_preconditioner.hpp │ ├── solution.cpp │ ├── solution.hpp │ ├── solution_base.cpp │ ├── solution_base.hpp │ ├── solver.cpp │ └── solver.hpp └── space │ ├── piecewise_constant_scalar_space.cpp │ ├── piecewise_constant_scalar_space.hpp │ ├── piecewise_linear_continuous_scalar_space.cpp │ ├── piecewise_linear_continuous_scalar_space.hpp │ ├── raviart_thomas_0_vector_space.cpp │ ├── raviart_thomas_0_vector_space.hpp │ ├── scalar_space.cpp │ ├── scalar_space.hpp │ ├── space.cpp │ ├── space.hpp │ ├── unit_scalar_space.cpp │ └── unit_scalar_space.hpp ├── python ├── CMakeLists.txt ├── bempp │ ├── CMakeLists.txt │ ├── __init__.py │ ├── armadillo.i │ ├── armadillo2numpy.i │ ├── assembly │ │ ├── abstract_boundary_operator.i │ │ ├── abstract_boundary_operator_sum.i │ │ ├── aca_approximate_lu_inverse.i │ │ ├── assembled_potential_operator.i │ │ ├── assembly_options.i │ │ ├── blocked_boundary_operator.i │ │ ├── blocked_operator_structure.i │ │ ├── boundary_operator.i │ │ ├── context.i │ │ ├── discrete_aca_boundary_operator.i │ │ ├── discrete_boundary_operator.i │ │ ├── discrete_dense_boundary_operator.i │ │ ├── discrete_inverse_sparse_boundary_operator.i │ │ ├── docstrings.i │ │ ├── evaluation_options.i │ │ ├── grid_function.i │ │ ├── helmholtz_3d_operators.i │ │ ├── helmholtz_3d_potential_operators.i │ │ ├── identity_operator.i │ │ ├── l2_norm.i │ │ ├── laplace_3d_operators.i │ │ ├── laplace_3d_potential_operators.i │ │ ├── laplace_beltrami_3d_operator.i │ │ ├── maxwell_3d_operators.i │ │ ├── maxwell_3d_potential_operators.i │ │ ├── modified_helmholtz_3d_operators.i │ │ ├── null_operator.i │ │ ├── numerical_quadrature_strategy.i │ │ ├── potential_operator.i │ │ ├── python_surface_normal_dependent_functor.i │ │ ├── python_surface_normal_independent_functor.i │ │ ├── scaled_abstract_boundary_operator.i │ │ ├── surface_normal_dependent_functor.i │ │ ├── surface_normal_independent_functor.i │ │ ├── symmetry.i │ │ └── transposition_mode.i │ ├── auto_ptr.i │ ├── bempp.swg │ ├── bempp_shared_ptr.i │ ├── common │ │ └── scalar_traits.i │ ├── config.i │ ├── converted_docstrings.txt │ ├── core.i │ ├── docstrings.i │ ├── fiber │ │ ├── accuracy_options.i │ │ ├── numerical_quadrature_strategy.i │ │ ├── opencl_options.i │ │ ├── parallelization_options.i │ │ ├── quadrature_options.i │ │ ├── quadrature_strategy.i │ │ └── verbosity_level.i │ ├── grid │ │ ├── entity.i │ │ ├── entity_iterator.i │ │ ├── entity_iterator_docstrings.i │ │ ├── entity_pointer.i │ │ ├── entity_pointer_docstrings.i │ │ ├── geometry.i │ │ ├── geometry_docstrings.i │ │ ├── geometry_factory.i │ │ ├── geometry_type.i │ │ ├── geometry_type_docstrings.i │ │ ├── grid.i │ │ ├── grid_docstrings.i │ │ ├── grid_factory.i │ │ ├── grid_factory_docstrings.i │ │ ├── grid_parameters.i │ │ ├── grid_view.i │ │ ├── grid_view_docstrings.i │ │ ├── id_set.i │ │ ├── id_set_docstrings.i │ │ ├── index_set.i │ │ ├── index_set_docstrings.i │ │ ├── vtk_writer.i │ │ └── vtk_writer_docstrings.i │ ├── lib.py │ ├── linalg │ │ ├── blocked_solution.i │ │ ├── default_iterative_solver.i │ │ ├── parameter_list.i │ │ ├── preconditioner.i │ │ ├── solution.i │ │ ├── solution_base.i │ │ └── solver.i │ ├── macros.i │ ├── numpy.i │ ├── postprocess_docstrings.py │ ├── py_defs.i │ ├── shapes.py │ ├── space │ │ ├── piecewise_constant_scalar_space.i │ │ ├── piecewise_linear_continuous_scalar_space.i │ │ ├── raviart_thomas_0_vector_space.i │ │ ├── space.i │ │ └── unit_scalar_space.i │ ├── template_instantiations_basis.i │ ├── template_instantiations_basis_kernel_result.i │ ├── template_instantiations_basis_result.i │ ├── template_instantiations_basis_result_geometry_factory.i │ ├── template_instantiations_result.i │ ├── template_instantiations_value.i │ ├── tools.py │ ├── trilinos.py │ └── visualization.py ├── doc │ ├── CMakeLists.txt │ ├── bempp_core.rst │ ├── bempp_lib.rst │ ├── bempp_visualization.rst │ ├── conf.py.in │ ├── index.rst │ └── postprocess_html.py ├── examples │ ├── CMakeLists.txt │ ├── combined_scatterer.py │ ├── maxwell_dirichlet.py │ ├── maxwell_photonic_jet.py │ ├── maxwell_scattering_diel.py │ ├── maxwell_scattering_pec.py │ ├── permeable_scatterer.py │ └── tutorial_dirichlet.py └── tests │ ├── CMakeLists.txt │ ├── integration │ ├── CMakeLists.txt │ ├── dot_2layer_direct.py │ ├── dot_3layer_direct.py │ ├── vtk_export.py │ └── vtk_export_structured_grid.py │ └── unit │ ├── CMakeLists.txt │ ├── README.txt │ ├── run_tests.py │ ├── test_entity.py │ ├── test_geometry.py │ ├── test_grid.py │ ├── test_grid_factory.py │ ├── test_grid_view.py │ ├── test_id_set.py │ ├── test_index_set.py │ └── test_vtk_writer.py ├── test_blas ├── CMakeLists.txt ├── test_blas.cpp ├── test_sdot_returns_double.cpp ├── test_sdot_returns_float.cpp ├── test_zdotc.cpp └── test_zdotc_g77.cpp ├── test_lapack ├── CMakeLists.txt └── test_lapack.cpp └── tests ├── CMakeLists.txt ├── integration ├── CMakeLists.txt ├── dirichlet.cpp ├── dot_three_layers.cpp ├── dot_two_layers.cpp ├── helmholtz.cpp ├── maxwell_dirichlet.cpp ├── meshes.cpp └── meshes.hpp └── unit ├── CMakeLists.txt ├── assembly ├── create_regular_grid.cpp ├── create_regular_grid.hpp ├── test_aca_mode_assembly.cpp ├── test_adjoint_abstract_boundary_operator.cpp ├── test_blocked_boundary_operator.cpp ├── test_complexified_discrete_boundary_operator.cpp ├── test_discrete_aca_boundary_operator.cpp ├── test_discrete_boundary_operator_sum.cpp ├── test_discrete_dense_boundary_operator.cpp ├── test_discrete_inverse_sparse_boundary_operator.cpp ├── test_discrete_null_boundary_operator.cpp ├── test_discrete_sparse_boundary_operator.cpp ├── test_grid_function.cpp ├── test_helmholtz_3d_adjoint_double_layer_boundary_operator.cpp ├── test_helmholtz_3d_double_layer_boundary_operator.cpp ├── test_helmholtz_3d_hypersingular_boundary_operator.cpp ├── test_helmholtz_3d_single_layer_boundary_operator.cpp ├── test_joint_assembly.cpp ├── test_laplace_3d_hypersingular_boundary_operator.cpp ├── test_modified_helmholtz_3d_adjoint_double_layer_boundary_operator.cpp ├── test_modified_helmholtz_3d_double_layer_boundary_operator.cpp ├── test_modified_helmholtz_3d_hypersingular_boundary_operator.cpp ├── test_modified_helmholtz_3d_single_layer_boundary_operator.cpp ├── test_scaled_discrete_boundary_operator.cpp └── test_transposed_discrete_boundary_operator.cpp ├── boost_test_case_num_template.hpp ├── check_arrays_are_close.hpp ├── fiber ├── test_accuracy_options_ex.cpp ├── test_default_local_assembler_for_integral_operators_on_surfaces.cpp ├── test_laplace_3d_adjoint_double_layer_potential_kernel.cpp ├── test_laplace_3d_double_layer_potential_kernel.cpp ├── test_laplace_3d_single_layer_potential_kernel.cpp ├── test_modified_helmholtz_3d_adjoint_double_layer_potential_kernel_interpolated_functor.cpp ├── test_modified_helmholtz_3d_double_layer_potential_kernel_interpolated_functor.cpp ├── test_modified_helmholtz_3d_single_layer_potential_kernel_interpolated_functor.cpp ├── test_piecewise_constant_scalar_basis.cpp ├── test_piecewise_linear_continuous_scalar_basis.cpp └── test_surface_curl_3d_functor.cpp ├── grid ├── test_entity.cpp ├── test_entity.hpp ├── test_geometry.cpp ├── test_grid.cpp ├── test_grid.hpp ├── test_grid_factory.cpp ├── test_grid_view.cpp ├── test_grid_view.hpp ├── test_id_set.cpp ├── test_id_set.hpp ├── test_index_set.cpp └── test_index_set.hpp ├── linalg ├── laplace_3d_dirichlet_fixture.cpp ├── laplace_3d_dirichlet_fixture.hpp ├── test_belos_solver_wrapper.cpp ├── test_default_direct_solver.cpp └── test_default_iterative_solver.cpp ├── main.cpp ├── meshes ├── cube-12-reoriented-shifted-on-x-by-2.msh ├── cube-12-reoriented-shifted-on-x-by-4.msh ├── cube-12-reoriented.msh ├── simple_mesh.geo ├── simple_mesh_2_elements.msh ├── simple_mesh_9_elements.msh ├── sphere-ico-1-shifted-by-3.msh ├── sphere-ico-1-shifted-by-6.msh ├── sphere-ico-1.msh ├── sphere-ico-2-shifted-by-3.msh ├── sphere-ico-2-shifted-by-6.msh ├── sphere-ico-2.msh ├── two_disjoint_triangles.msh ├── two_triangles_sharing_edges_0_and_0.msh ├── two_triangles_sharing_edges_1_and_0.msh ├── two_triangles_sharing_vertex_0.msh ├── two_triangles_sharing_vertices_1_and_0.msh └── two_triangles_sharing_vertices_2_and_0.msh ├── num_template.hpp ├── random_arrays.hpp └── type_template.hpp /.build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Usage: .build.sh 4 | 5 | set -e 6 | . $1 7 | 8 | export LD_LIBRARY_PATH="$Main_prefix/bempp/lib:$LD_LIBRARY_PATH" 9 | export DYLD_LIBRARY_PATH="$Main_prefix/bempp/lib:$DYLD_LIBRARY_PATH" 10 | 11 | mkdir "$Bempp_build_dir" 12 | cd $Bempp_build_dir 13 | CXXFLAGS="$Bempp_cxxflags" CFLAGS="$Bempp_cflags" "$CMake_exe" \ 14 | -D CMAKE_CXX_COMPILER:STRING="$Bempp_cxx" \ 15 | -D CMAKE_C_COMPILER:STRING="$Bempp_cc" \ 16 | -D CMAKE_INSTALL_PREFIX:PATH="$Main_prefix" \ 17 | -D CMAKE_BUILD_TYPE:STRING="$Bempp_build_type" \ 18 | -D WITH_AHMED:STRING="$AHMED_with_ahmed" \ 19 | -D BOOST_INCLUDE_DIR:PATH="$Boost_include_dir" \ 20 | -D BOOST_UNIT_TEST_LIB:PATH="$Boost_unit_test_lib" \ 21 | -D BLAS_LIBRARIES:STRING="$BLAS_lib" \ 22 | -D LAPACK_LIBRARIES:STRING="$LAPACK_lib" \ 23 | -D ARMADILLO_INCLUDE_DIR:PATH="$Armadillo_include_dir" \ 24 | -D TBB_INCLUDE_DIR:PATH="$Tbb_include_dir" \ 25 | -D TBB_LIBRARY:PATH="$Tbb_lib" \ 26 | -D TBB_LIBRARY_DEBUG:PATH="$Tbb_lib_debug" \ 27 | -D AHMED_INCLUDE_DIR:PATH="$AHMED_include_dir" \ 28 | -D AHMED_LIB:PATH="$AHMED_lib" \ 29 | -D PYTHON_EXECUTABLE:PATH="$Python_exe" \ 30 | -D PYTHON_INCLUDE_DIR:PATH="$Python_include_dir" \ 31 | -D PYTHON_NUMPY_INCLUDE_DIR:PATH="$Python_numpy_include_dir" \ 32 | -D PYTHON_LIBRARY:PATH="$Python_lib" \ 33 | -D SWIG_EXECUTABLE:PATH="$Swig_exe" \ 34 | -D TRILINOS_CMAKE_PATH:PATH="$Trilinos_cmake_path" \ 35 | -D WITH_MKL:BOOL="$MKL_enable_mkl" \ 36 | "$Main_root_dir" 37 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /build* 2 | *~ 3 | .cproject 4 | .project 5 | *.DS_Store 6 | /nbproject/private/ 7 | /contrib/ahmed/ 8 | /contrib/armadillo* 9 | /contrib/dune/ 10 | /contrib/boost/ 11 | /contrib/files/ 12 | /contrib/tbb/ 13 | /contrib/trilinos/ 14 | /contrib/swig/ 15 | /contrib/dune-common/dune/common/.deps/ 16 | /contrib/dune-common/lib/.deps/ 17 | /contrib/dune-common/dune/common/test/.deps/ 18 | /contrib/dune-common/dune/common/parallel/test/.deps/ 19 | /contrib/dune-common/dune/common/.libs/ 20 | /contrib/dune-common/lib/.libs/ 21 | /doc/build* 22 | *.pyc 23 | options.cfg 24 | CMakeLists.txt.user 25 | scratch 26 | test_blas/build 27 | test_lapack/build 28 | *.generated 29 | .options.cfg 30 | installer/files 31 | bempp_setup.err 32 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | project(bempp) 3 | 4 | set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DNDEBUG -O3") 5 | set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DNDEBUG -O3") 6 | 7 | # Module Path 8 | set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) 9 | 10 | # Macros needed 11 | include(BemppOptions) 12 | include(BemppFindDependencies) 13 | 14 | # set(CMAKE_CXX_FLAGS "-Wall -Wnon-virtual-dtor -Wno-sign-compare") 15 | 16 | # Main library 17 | add_subdirectory(lib) 18 | 19 | # Python Support 20 | add_subdirectory(python) 21 | 22 | # Examples 23 | add_subdirectory(examples) 24 | 25 | # Scratch 26 | if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/scratch/CMakeLists.txt") 27 | add_subdirectory(scratch) 28 | endif () 29 | 30 | # Tests 31 | if (WITH_TESTS) 32 | add_subdirectory(tests) 33 | endif (WITH_TESTS) 34 | 35 | # Uninstall target 36 | configure_file( 37 | "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" 38 | "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" 39 | IMMEDIATE @ONLY) 40 | 41 | add_custom_target(uninstall 42 | COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) 43 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 1.1.2 2 | -------------------------------------------------------------------------------- /cmake/BemppConfig.cmake.in: -------------------------------------------------------------------------------- 1 | # - Config file for the BEM++ package 2 | 3 | # include(@CMAKE_INSTALL_PREFIX@/bempp/lib/cmake/Trilinos/TrilinosConfig.cmake) 4 | # include(@CMAKE_INSTALL_PREFIX@/bempp/lib/cmake/Bempp/BemppLibraryDepends.cmake) 5 | 6 | # set(BEMPP_INCLUDE_DIRS @CMAKE_INSTALL_PREFIX@/bempp/include) 7 | # set(BEMPP_LIBRARIES bempp) 8 | 9 | set(BEMPP_PREFIX @CMAKE_INSTALL_PREFIX@) 10 | set(BEMPP_LIBRARY_DIR ${BEMPP_PREFIX}/bempp/lib) 11 | set(BEMPP_INCLUDE_DIR ${BEMPP_PREFIX}/bempp/include) 12 | set(BEMPP_LIBRARY @BEMPP_LIBRARY@) 13 | set(BEMPP_TEUCHOS_LIBRARY @BEMPP_TEUCHOS_LIBRARY@) 14 | set(BEMPP_PYTHON_INCLUDE_DIRS @PYTHON_INCLUDE_DIR@ @PYTHON_NUMPY_INCLUDE_DIR@) 15 | set(BEMPP_PYTHON_LIBRARY @PYTHON_LIBRARY@) 16 | -------------------------------------------------------------------------------- /cmake/BemppConfigLocation.in: -------------------------------------------------------------------------------- 1 | @CMAKE_INSTALL_PREFIX@/bempp 2 | -------------------------------------------------------------------------------- /cmake/BemppFindDependencies.cmake: -------------------------------------------------------------------------------- 1 | # Boost 2 | set(BOOST_INCLUDE_DIR "" CACHE PATH "Directory containing Boost header files") 3 | set(BOOST_UNIT_TEST_LIB "" CACHE PATH "Full path to Boost unit test library") 4 | 5 | # BLAS 6 | set(BLAS_LIBRARIES "" CACHE STRING "Semicolon-separated list of full paths to BLAS libs") 7 | set(BLAS_INCLUDE_DIR "" CACHE PATH "Directory containing BLAS header files (used only with MKL, GotoBLAS and OpenBLAS)") 8 | 9 | # LAPACK 10 | set(LAPACK_LIBRARIES "" CACHE STRING "Semicolon-separated list of full paths to LAPACK libs") 11 | set(LAPACK_INCLUDE_DIR "" CACHE PATH "Directory containing LAPACK header files (used only with MKL, GotoBLAS and OpenBLAS)") 12 | 13 | # ARMADILLO 14 | set(ARMADILLO_INCLUDE_DIR "" CACHE PATH "Directory containing Armadillo header files") 15 | 16 | # Threading building blocks 17 | set(TBB_INCLUDE_DIR "" CACHE PATH "Directory containing Intel TBB header files") 18 | set(TBB_LIBRARY "" CACHE PATH "Full path to the TBB library") 19 | set(TBB_LIBRARY_DEBUG "" CACHE PATH "Full path to the TBB debug library") 20 | 21 | # Ahmed (optional, used only if WITH_AHMED is set) 22 | if (WITH_AHMED) 23 | set(AHMED_INCLUDE_DIR "" CACHE PATH "Full path to the AHMED include directory") 24 | set(AHMED_LIB "" CACHE PATH "Full path to AHMED library") 25 | endif () 26 | 27 | # CUDA support 28 | if (WITH_CUDA) 29 | FIND_PACKAGE(CUDA) 30 | endif () 31 | 32 | # Dune 33 | find_library(LIB_DUNE_COMMON dunecommon ${CMAKE_INSTALL_PREFIX}/bempp/lib) 34 | find_library(LIB_DUNE_GRID dunegrid ${CMAKE_INSTALL_PREFIX}/bempp/lib) 35 | file(GLOB_RECURSE DUNE_HEADERS ${CMAKE_INSTALL_PREFIX}/bempp/include/dune/*.hh) 36 | 37 | # Trilinos 38 | set(TRILINOS_CMAKE_PATH "" CACHE PATH "Directory containing TrilinosConfig.cmake") 39 | include(${TRILINOS_CMAKE_PATH}/TrilinosConfig.cmake) 40 | 41 | 42 | -------------------------------------------------------------------------------- /cmake/BemppOptions.cmake: -------------------------------------------------------------------------------- 1 | # Options (can be modified by user) 2 | option(WITH_TESTS "Compile unit tests (can be run with 'make test')" ON) 3 | option(WITH_INTEGRATION_TESTS "Compile integration tests" OFF) 4 | option(WITH_AHMED "Link to the AHMED library to enable ACA mode assembly)" OFF) 5 | option(WITH_OPENCL "Add OpenCL support for Fiber module" OFF) 6 | option(WITH_CUDA "Add CUDA support for Fiber module" OFF) 7 | option(WITH_ALUGRID "Have Alugrid" OFF) 8 | option(WITH_MKL "Use Intel MKL for BLAS and LAPACK functionality" OFF) 9 | option(WITH_GOTOBLAS "Use GotoBLAS for BLAS and LAPACK functionality" OFF) 10 | option(WITH_OPENBLAS "Use OpenBLAS for BLAS and LAPACK functionality" OFF) 11 | 12 | option(ENABLE_SINGLE_PRECISION "Enable support for single-precision calculations" ON) 13 | option(ENABLE_DOUBLE_PRECISION "Enable support for double-precision calculations" ON) 14 | option(ENABLE_COMPLEX_KERNELS "Enable support for complex-valued kernel functions" ON) 15 | option(ENABLE_COMPLEX_BASIS_FUNCTIONS "Enable support for complex-valued basis functions" ON) 16 | -------------------------------------------------------------------------------- /cmake/DUNE-COPYING-CMAKE-SCRIPTS: -------------------------------------------------------------------------------- 1 | Redistribution and use in source and binary forms, with or without 2 | modification, are permitted provided that the following conditions 3 | are met: 4 | 1. Redistributions of source code must retain the copyright 5 | notice, this list of conditions and the following disclaimer. 6 | 2. Redistributions in binary form must reproduce the copyright 7 | notice, this list of conditions and the following disclaimer in the 8 | documentation and/or other materials provided with the distribution. 9 | 3. The name of the author may not be used to endorse or promote products 10 | derived from this software without specific prior written permission. 11 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 12 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 13 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 14 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 15 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 16 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 17 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 18 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 19 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 20 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 21 | -------------------------------------------------------------------------------- /cmake/DuneUtils.cmake: -------------------------------------------------------------------------------- 1 | # Please observe: line 32 and 33 only work with newer DUNE modules. 2 | # IF you use an old module, that has a symlink "dune -> .", you have to remove "/dune/" from these lines! 3 | 4 | MACRO( ADD_CXX_FLAGS ) 5 | FOREACH( ARG ${ARGN} ) 6 | ADD_DEFINITIONS( ${ARG} ) 7 | LIST( APPEND MY_CXX_FLAGS ${ARG} ) 8 | ENDFOREACH( ARG ) 9 | ENDMACRO( ADD_CXX_FLAGS ) 10 | 11 | MACRO( INCLUDE_DIR ) 12 | FOREACH( ARG ${ARGN} ) 13 | INCLUDE_DIRECTORIES( ${ARG} ) 14 | LIST( APPEND MY_CXX_FLAGS "-I${ARGN}" ) 15 | ENDFOREACH( ARG ) 16 | ENDMACRO( INCLUDE_DIR ) 17 | 18 | MACRO( HEADERCHECK ) 19 | ADD_CUSTOM_TARGET( headercheck ) 20 | FOREACH( HEADER ${ARGN} ) 21 | GET_FILENAME_COMPONENT( fn ${HEADER} NAME ) 22 | SET( TEST_NAME "headercheck_${fn}" ) 23 | ADD_CUSTOM_TARGET( ${TEST_NAME} ${CMAKE_CXX_COMPILER} ${MY_CXX_FLAGS} -c ${HEADER} -o ${CMAKE_BINARY_DIR}/tests/${TEST_NAME}.o ) 24 | ADD_TEST( ${TEST_NAME} ${CMAKE_CXX_COMPILER} ${MY_CXX_FLAGS} -c ${HEADER} -o ${CMAKE_BINARY_DIR}/tests/${TEST_NAME}.o ) 25 | add_dependencies( headercheck ${TEST_NAME} ) 26 | ENDFOREACH( HEADER ) 27 | ENDMACRO( HEADERCHECK ) 28 | 29 | MACRO( ADD_DUNE_MODULES ) 30 | FOREACH( MODULE ${ARGN} ) 31 | INCLUDE_DIR( ${DUNE_PATH}/dune-${MODULE} ) 32 | LINK_DIRECTORIES( ${DUNE_PATH}/dune-${MODULE}/dune/${MODULE}/.libs ) 33 | FILE( GLOB_RECURSE tmp_header "${DUNE_PATH}/dune-${MODULE}/dune/${MODULE}/*.hh" ) 34 | LIST( APPEND DUNE_HEADERS ${tmp_header} ) 35 | ENDFOREACH( MODULE ) 36 | ENDMACRO( ADD_DUNE_MODULES ) 37 | 38 | -------------------------------------------------------------------------------- /cmake/FindSphinx.cmake: -------------------------------------------------------------------------------- 1 | find_program(SPHINX_EXECUTABLE NAMES sphinx-build 2 | HINTS 3 | $ENV{SPHINX_DIR} 4 | PATH_SUFFIXES bin 5 | DOC "Sphinx documentation generator" 6 | ) 7 | include(FindPackageHandleStandardArgs) 8 | find_package_handle_standard_args(Sphinx DEFAULT_MSG SPHINX_EXECUTABLE) 9 | mark_as_advanced(SPHINX_EXECUTABLE) -------------------------------------------------------------------------------- /cmake_uninstall.cmake.in: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | if (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 3 | message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") 4 | endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 5 | 6 | file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) 7 | string(REGEX REPLACE "\n" ";" files "${files}") 8 | list(REVERSE files) 9 | foreach (file ${files}) 10 | message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") 11 | if (EXISTS "$ENV{DESTDIR}${file}") 12 | execute_process( 13 | COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}" 14 | OUTPUT_VARIABLE rm_out 15 | RESULT_VARIABLE rm_retval 16 | ) 17 | if(NOT ${rm_retval} EQUAL 0) 18 | message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") 19 | endif (NOT ${rm_retval} EQUAL 0) 20 | else (EXISTS "$ENV{DESTDIR}${file}") 21 | message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") 22 | endif (EXISTS "$ENV{DESTDIR}${file}") 23 | endforeach(file) 24 | -------------------------------------------------------------------------------- /contrib/dune/LICENSE: -------------------------------------------------------------------------------- 1 | The DUNE library and headers are licensed under version 2 of the GNU General Public License, with a special exception for linking and compiling against DUNE, the so-called "runtime exception." The license is intended to be similiar to the GNU Lesser General Public License, which by itself isn't suitable for a template library. 2 | 3 | For further information see 4 | 5 | http://www.dune-project.org/license.html 6 | -------------------------------------------------------------------------------- /contrib/dune/dune-foamgrid/.gitignore: -------------------------------------------------------------------------------- 1 | # these are ignored by git 2 | # For a project mostly in C, the following would be a good set of 3 | # exclude patterns (uncomment them if you want to use them): 4 | # *.[oa] 5 | # *~ 6 | 7 | .deps 8 | .*.swp 9 | *.la 10 | *.o 11 | Makefile 12 | Makefile.in 13 | 14 | # / 15 | /config.* 16 | /configure 17 | /aclocal.m4 18 | /dependencies.m4 19 | /autom4te.cache 20 | /depcomp 21 | /install-sh 22 | /missing 23 | /libtool 24 | /stamp-h1 25 | /ltmain.sh 26 | /am 27 | /dune-foamgrid.pc 28 | 29 | # /doc/doxygen/ 30 | /doc/doxygen/html 31 | /doc/doxygen/doxygen-tag 32 | /doc/doxygen/doxyerr.log 33 | /doc/doxygen/doxygen.log 34 | /doc/doxygen/Doxyfile 35 | /doc/doxygen/Doxyfile.in 36 | 37 | ## /src 38 | /src/dune_foamgrid 39 | 40 | # /dune/foamgrid/test 41 | -------------------------------------------------------------------------------- /contrib/dune/dune-foamgrid/Makefile.am: -------------------------------------------------------------------------------- 1 | # $Id: duneproject 5502 2009-04-03 15:05:58Z sander $ 2 | 3 | # we need the module file to be able to build via dunecontrol 4 | EXTRA_DIST=dune.module 5 | 6 | SUBDIRS = dune doc m4 src 7 | 8 | # don't follow the full GNU-standard 9 | # we need automake 1.5 10 | AUTOMAKE_OPTIONS = foreign 1.5 11 | 12 | # pass most important options when "make distcheck" is used 13 | DISTCHECK_CONFIGURE_FLAGS = --with-dune-common=$(DUNE_COMMON_ROOT) --with-dune-grid=$(DUNE_GRID_ROOT) CXX="$(CXX)" CC="$(CC)" 14 | 15 | include $(top_srcdir)/am/top-rules 16 | include $(top_srcdir)/am/global-rules 17 | 18 | -------------------------------------------------------------------------------- /contrib/dune/dune-foamgrid/configure.ac: -------------------------------------------------------------------------------- 1 | # -*- Autoconf -*- 2 | # Process this file with autoconf to produce a configure script. 3 | AC_PREREQ(2.50) 4 | DUNE_AC_INIT # gets module version from dune.module file 5 | AM_INIT_AUTOMAKE 6 | AC_CONFIG_SRCDIR([src/dune_foamgrid.cc]) 7 | AM_CONFIG_HEADER([config.h]) 8 | 9 | 10 | # we need no more than the standard DE-stuff 11 | # this module depends on dune-common dune-grid 12 | # this implies checking for [dune-common], [dune-grid] 13 | DUNE_CHECK_ALL 14 | 15 | # implicitly set the Dune-flags everywhere 16 | AC_SUBST(AM_CPPFLAGS, $DUNE_CPPFLAGS) 17 | AC_SUBST(AM_LDFLAGS, $DUNE_LDFLAGS) 18 | LIBS="$DUNE_LIBS" 19 | 20 | AC_CONFIG_FILES([ 21 | Makefile 22 | src/Makefile 23 | dune/Makefile 24 | dune/foamgrid/Makefile 25 | dune/foamgrid/foamgrid/Makefile 26 | dune/foamgrid/test/Makefile 27 | doc/Makefile 28 | doc/doxygen/Makefile 29 | doc/doxygen/Doxyfile 30 | m4/Makefile 31 | dune-foamgrid.pc 32 | ]) 33 | AC_OUTPUT 34 | # finally print the summary information 35 | DUNE_SUMMARY_ALL 36 | -------------------------------------------------------------------------------- /contrib/dune/dune-foamgrid/doc/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | SUBDIRS = doxygen 3 | 4 | CURDIR = doc 5 | 6 | BASEDIR = .. 7 | 8 | docdir=$(datadir)/doc/dune-foamgrid 9 | 10 | include $(top_srcdir)/am/webstuff 11 | 12 | CLEANFILES = $(PAGES) 13 | 14 | if ! BUILD_DOCS 15 | # add tag to notify that dist has been build without documentation 16 | dist-hook: 17 | echo "# No documentation included in distribution! " > $(distdir)/$(DOCUMENTATION_TAG_FILE) 18 | endif 19 | 20 | include $(top_srcdir)/am/global-rules 21 | -------------------------------------------------------------------------------- /contrib/dune/dune-foamgrid/doc/doxygen/Doxylocal: -------------------------------------------------------------------------------- 1 | INPUT += @top_srcdir@/dune/foamgrid 2 | EXCLUDE += 3 | EXAMPLE_PATH += 4 | EXAMPLE_PATTERNS += 5 | IMAGE_PATH += 6 | PREDEFINED += DOXYGEN 7 | -------------------------------------------------------------------------------- /contrib/dune/dune-foamgrid/doc/doxygen/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | BASEDIR=../.. 3 | CURDIR=doc/doxygen 4 | 5 | include $(top_srcdir)/am/doxygen 6 | include $(top_srcdir)/am/global-rules 7 | 8 | -------------------------------------------------------------------------------- /contrib/dune/dune-foamgrid/dune-foamgrid.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | CXX=@CXX@ 6 | CC=@CC@ 7 | DEPENDENCIES=@REQUIRES@ 8 | 9 | Name: @PACKAGE_NAME@ 10 | Version: @VERSION@ 11 | Description: dune-foamgrid module 12 | URL: http://dune-project.org/ 13 | Requires: dune-common dune-grid 14 | Libs: -L 15 | Cflags: -I 16 | -------------------------------------------------------------------------------- /contrib/dune/dune-foamgrid/dune.module: -------------------------------------------------------------------------------- 1 | ################################ 2 | # Dune module information file # 3 | ################################ 4 | 5 | #Name of the module 6 | Module: dune-foamgrid 7 | Version: 2.1 8 | Maintainer: sander@mi.fu-berlin.de 9 | #depending on 10 | Depends: dune-common dune-grid 11 | -------------------------------------------------------------------------------- /contrib/dune/dune-foamgrid/dune/Makefile.am: -------------------------------------------------------------------------------- 1 | # $Id: $ 2 | 3 | SUBDIRS = foamgrid 4 | 5 | include $(top_srcdir)/am/global-rules 6 | -------------------------------------------------------------------------------- /contrib/dune/dune-foamgrid/dune/foamgrid/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | SUBDIRS = foamgrid test 3 | 4 | foamgriddir = $(includedir)/dune/foamgrid 5 | 6 | foamgrid_HEADERS = foamgrid.hh 7 | 8 | include $(top_srcdir)/am/global-rules 9 | -------------------------------------------------------------------------------- /contrib/dune/dune-foamgrid/dune/foamgrid/foamgrid/Makefile.am: -------------------------------------------------------------------------------- 1 | foamgriddir = $(includedir)/dune/foamgrid/foamgrid 2 | 3 | foamgrid_HEADERS = foamgridedge.hh \ 4 | foamgridelements.hh \ 5 | foamgridentity.hh \ 6 | foamgridentitypointer.hh \ 7 | foamgridfactory.hh \ 8 | foamgridgeometry.hh \ 9 | foamgridhierarchiciterator.hh \ 10 | foamgridindexsets.hh \ 11 | foamgridintersectioniterators.hh \ 12 | foamgridintersections.hh \ 13 | foamgridleafiterator.hh \ 14 | foamgridleveliterator.hh \ 15 | foamgridvertex.hh 16 | 17 | include $(top_srcdir)/am/global-rules 18 | -------------------------------------------------------------------------------- /contrib/dune/dune-foamgrid/dune/foamgrid/foamgrid/foamgridelements.hh: -------------------------------------------------------------------------------- 1 | #ifndef DUNE_FOAMGRID_ELEMENTS_HH 2 | #define DUNE_FOAMGRID_ELEMENTS_HH 3 | 4 | #include 5 | #include 6 | 7 | namespace Dune { 8 | 9 | template 10 | class FoamGridEntityImp<2,dimworld> 11 | : public FoamGridEntityBase 12 | { 13 | public: 14 | 15 | /** \brief The different ways to mark an element for grid changes */ 16 | enum MarkState { DO_NOTHING , COARSEN , REFINE }; 17 | 18 | FoamGridEntityImp(int level, unsigned int id) 19 | : FoamGridEntityBase(level,id), 20 | markState_(DO_NOTHING), isNew_(false) 21 | { 22 | sons_[0] = sons_[1] = NULL; 23 | } 24 | 25 | bool isLeaf() const { 26 | // The sons are either all NULL or all != NULL 27 | return sons_[0] == NULL; 28 | } 29 | 30 | unsigned int corners() const { 31 | return 3; 32 | } 33 | 34 | GeometryType type() const { 35 | return GeometryType(GeometryType::simplex, 2); 36 | } 37 | 38 | /** \todo Implement me! */ 39 | unsigned int nSons() const { 40 | return 0; 41 | } 42 | 43 | array*, 4> sons_; 44 | 45 | FoamGridEntityImp<2,dimworld>* father_; 46 | 47 | array*, 3> edges_; 48 | 49 | FoamGridEntityImp<0,dimworld>* vertex_[3]; 50 | 51 | /** \brief Stores requests for refinement and coarsening */ 52 | MarkState markState_; 53 | 54 | /** \brief This flag is set by adapt() if this element has been newly created. */ 55 | bool isNew_; 56 | 57 | }; 58 | 59 | } 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /contrib/dune/dune-foamgrid/dune/foamgrid/foamgrid/foamgridgeometry.hh: -------------------------------------------------------------------------------- 1 | #ifndef DUNE_FOAMGRID_GEOMETRY_HH 2 | #define DUNE_FOAMGRID_GEOMETRY_HH 3 | 4 | /** \file 5 | * \brief The FoamGridGeometry class and its specializations 6 | */ 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | 13 | namespace Dune { 14 | 15 | template 16 | class FoamGridGeometry : 17 | public GenericGeometry::BasicGeometry > 18 | { 19 | 20 | typedef typename GenericGeometry::BasicGeometry > Base; 21 | 22 | public: 23 | 24 | /** \brief Constructor with a geometry type and a set of corners */ 25 | void setup(const GeometryType& type, const std::vector >& coordinates) 26 | { 27 | // set up base class 28 | // Yes, a strange way, but the only way, as BasicGeometry doesn't have a setup method 29 | Base::operator=(Base(type,coordinates)); 30 | } 31 | 32 | }; 33 | 34 | 35 | } // namespace Dune 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /contrib/dune/dune-foamgrid/dune/foamgrid/test/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | TESTPROGS = foamgrid-test 3 | 4 | # which tests to run 5 | TESTS = $(TESTPROGS) 6 | 7 | # programs just to build when "make check" is used 8 | check_PROGRAMS = $(TESTPROGS) 9 | 10 | AM_LDFLAGS = @AM_LDFLAGS@ 11 | AM_CXXFLAGS = -Wall -g 12 | 13 | # The directory where the example grid files used for testing are located. 14 | AM_CPPFLAGS+=-DDUNE_GRID_EXAMPLE_GRIDS_PATH=\"$(DUNE_GRID_ROOT)/doc/grids/\" 15 | 16 | # define the programs 17 | foamgrid_test_SOURCES = foamgrid-test.cc 18 | 19 | include $(top_srcdir)/am/global-rules 20 | -------------------------------------------------------------------------------- /contrib/dune/dune-foamgrid/m4/Makefile.am: -------------------------------------------------------------------------------- 1 | M4FILES = dune-foamgrid.m4 2 | 3 | aclocaldir = $(datadir)/aclocal 4 | aclocal_DATA = $(M4FILES) 5 | 6 | EXTRA_DIST = $(M4FILES) 7 | 8 | include $(top_srcdir)/am/global-rules 9 | -------------------------------------------------------------------------------- /contrib/dune/dune-foamgrid/m4/dune-foamgrid.m4: -------------------------------------------------------------------------------- 1 | # Additional checks needed to build the module 2 | AC_DEFUN([DUNE_FOAMGRID_CHECKS]) 3 | 4 | # Additional checks needed to find the module 5 | AC_DEFUN([DUNE_FOAMGRID_CHECK_MODULE]),[ 6 | DUNE_CHECK_MODULES([dune-foamgrid], [dune-foamgrid/foamgrid.hh]) 7 | ]) 8 | -------------------------------------------------------------------------------- /contrib/dune/dune-foamgrid/src/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | SUBDIRS = 3 | 4 | noinst_PROGRAMS = dune_foamgrid 5 | 6 | dune_foamgrid_SOURCES = dune_foamgrid.cc 7 | 8 | dune_foamgrid_CXXFLAGS = $(MPI_CPPFLAGS) $(UG_CPPFLAGS) $(AMIRAMESH_CPPFLAGS) $(ALU_CPPFLAGS) 9 | dune_foamgrid_LDADD = $(MPI_LDFLAGS) $(ALU_LIBS) $(AMIRAMESH_LDFLAGS) $(AMIRAMESH_LIBS) $(UG_LDFLAGS) $(UG_LIBS) $(MPI_LDFLAGS) $(DUNE_LDFLAGS) $(DUNE_LIBS) 10 | 11 | # don't follow the full GNU-standard 12 | # we need automake 1.5 13 | AUTOMAKE_OPTIONS = foreign 1.5 14 | 15 | # pass most important options when "make distcheck" is used 16 | DISTCHECK_CONFIGURE_FLAGS = --with-dune-common=$(DUNE_COMMON_ROOT) --with-dune-grid=$(DUNE_GRID_ROOT) CXX="$(CXX)" CC="$(CC)" 17 | 18 | include $(top_srcdir)/am/global-rules 19 | 20 | -------------------------------------------------------------------------------- /contrib/dune/dune-foamgrid/src/dune_foamgrid.cc: -------------------------------------------------------------------------------- 1 | #ifdef HAVE_CONFIG_H 2 | # include "config.h" 3 | #endif 4 | #include 5 | #include"dune/common/mpihelper.hh" // An initializer of MPI 6 | #include"dune/common/exceptions.hh" // We use exceptions 7 | 8 | int main(int argc, char** argv) 9 | { 10 | try{ 11 | //Maybe initialize Mpi 12 | Dune::MPIHelper& helper = Dune::MPIHelper::instance(argc, argv); 13 | std::cout << "Hello World! This is dune-foamgrid." << std::endl; 14 | if(Dune::MPIHelper::isFake) 15 | std::cout<< "This is a sequential program." << std::endl; 16 | else 17 | std::cout<<"I am rank "<::magnitudeType MagnitudeType; 8 | this->setLinePrefix("BELOS/T"); 9 | // ToDo: Validate input 10 | lp_ = lp; 11 | @@ -139,13 +140,13 @@ 12 | // not, use the default from the solver. 13 | if ( !is_null(solverPL_) ) { 14 | if (solverPL_->isParameter("Convergence Tolerance")) { 15 | - defaultTol_ = solverPL_->get("Convergence Tolerance"); 16 | + defaultTol_ = solverPL_->get("Convergence Tolerance"); 17 | } 18 | } 19 | else { 20 | RCP defaultPL = 21 | iterativeSolver->getValidParameters(); 22 | - defaultTol_ = defaultPL->get("Convergence Tolerance"); 23 | + defaultTol_ = defaultPL->get("Convergence Tolerance"); 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /installer/patches/ahmed_ACAn_inext_jnext_ACA.h.patch: -------------------------------------------------------------------------------- 1 | --- ACA.h.debug-messages 2013-02-13 16:53:01.000000000 +0000 2 | +++ ACA.h.ACAn-inext-jnext 2013-02-13 16:54:14.000000000 +0000 3 | @@ -385,7 +385,7 @@ 4 | const cluster* c1, const cluster* c2) 5 | { 6 | typedef typename num_traits::abs_type abs_T; 7 | - unsigned l, no = 0, j0, inext; 8 | + unsigned l, no = 0, j0, inext, jnext; 9 | // klast is the number of successful steps applied to the last pivotal row 10 | unsigned kmin, keps, k_old; 11 | abs_T nrmlsk2, nrms2 = 0.0; 12 | @@ -422,10 +422,10 @@ 13 | 14 | k_old = k; 15 | 16 | + inext = i0; 17 | do { 18 | 19 | // compute a cross 20 | - inext = i0; 21 | 22 | unsigned klast; 23 | ok = ACA_row_step(MatGen, b1, n1, b2, n2, klast, inext, k, no, Z, S, 24 | @@ -501,10 +501,10 @@ 25 | 26 | k_old = k; 27 | 28 | + jnext = j0; 29 | do { 30 | 31 | // compute a cross 32 | - unsigned jnext = j0; 33 | k_old = k; 34 | ok = ACA_col_step(MatGen, b1, n1, b2, n2, jnext, k, no, Z, S, 35 | U, V, nrmlsk2, scale, c1, c2); 36 | -------------------------------------------------------------------------------- /installer/patches/ahmed_addGeHGeH_single_precision.patch: -------------------------------------------------------------------------------- 1 | --- Include/H.h.orig 2012-08-29 14:11:33.000000000 +0100 2 | +++ Include/H.h 2012-08-29 14:12:06.000000000 +0100 3 | @@ -516,7 +516,7 @@ 4 | extern void addGeHGeM(blcluster*, mblock**, float*, unsigned, 5 | double, unsigned, contBasis* haar=NULL); 6 | extern void addGeHGeH(blcluster* bl, mblock** A, mblock** B, 7 | - float eps, unsigned rankmax, contBasis* haar=NULL); 8 | + double eps, unsigned rankmax, contBasis* haar=NULL); 9 | extern void addHeHLrM(blcluster*, mblock**, double, unsigned, unsigned, 10 | float*, unsigned, float*, unsigned, 11 | contBasis* haar=NULL); 12 | @@ -797,7 +797,7 @@ 13 | extern void addGeHGeM(blcluster*, mblock**, scomp*, unsigned, 14 | double, unsigned, contBasis* haar=NULL); 15 | extern void addGeHGeH(blcluster* bl, mblock** A, mblock** B, 16 | - scomp eps, unsigned rankmax, contBasis* haar=NULL); 17 | + double eps, unsigned rankmax, contBasis* haar=NULL); 18 | extern void addHeHLrM(blcluster*, mblock**, double, unsigned, unsigned, 19 | scomp*, unsigned, scomp*, unsigned, 20 | contBasis* haar=NULL); 21 | -------------------------------------------------------------------------------- /installer/patches/ahmed_blas.patch: -------------------------------------------------------------------------------- 1 | --- blas.h 2012-06-11 15:50:28.000000000 +0100 2 | +++ blas.h.new 2012-07-21 22:54:10.000000000 +0100 3 | @@ -12,6 +12,8 @@ 4 | #ifndef BLAS_H 5 | #define BLAS_H 6 | 7 | +#define G77CONVENTION 8 | + 9 | #include 10 | #include 11 | #include "cmplx.h" // Complex arthimetic 12 | -------------------------------------------------------------------------------- /installer/patches/ahmed_check_error_apprx.h.patch: -------------------------------------------------------------------------------- 1 | --- Include/apprx.h.generic_aca 2013-02-13 17:10:00.000000000 +0000 2 | +++ Include/apprx.h 2013-02-13 17:10:41.000000000 +0000 3 | @@ -59,7 +59,8 @@ 4 | } 5 | os.close(); 6 | // check whether it can be approximated using SVD 7 | - double* S = new double[MIN(n1, n2)]; 8 | + typedef typename num_traits::abs_type abs_T; 9 | + abs_T* S = new abs_T[MIN(n1, n2)]; 10 | unsigned nwk = 5*(n1+n2); 11 | T* wk = new T[nwk]; 12 | blas::svals(n1, n2, B, S, nwk, wk); 13 | -------------------------------------------------------------------------------- /installer/patches/ahmed_debug_messages_apprx.h.patch: -------------------------------------------------------------------------------- 1 | --- apprx.h.check_error 2013-02-13 17:10:41.000000000 +0000 2 | +++ apprx.h.debug-messages 2013-02-13 17:13:05.000000000 +0000 3 | @@ -28,7 +28,8 @@ 4 | void check_error(MATGEN_T& MatGen, bemblcluster* bl, double eps, 5 | mblock* mbl, unsigned i0) 6 | { 7 | - std::cout << "checking ACA error ... " << std::flush; 8 | + std::cout << "checking ACA error for block " << bl->getidx() << "... " 9 | + << std::flush; 10 | unsigned n1 = bl->getn1(), n2 = bl->getn2(); 11 | T *A = new T[n1*n2]; 12 | mbl->convLrM_toGeM(A, n1); 13 | @@ -47,10 +48,13 @@ 14 | if ((dnrm>0.0 && sqrt(dmax/dnrm)>20*eps) || (dnrm==0.0 && dmax>eps)) { 15 | double maxerr = sqrt(dmax/dnrm); 16 | std::cout << "eps=" << eps << ", maxerr=" << maxerr << std::endl; 17 | + std::cout << bl->getidx() << " -> FAILED" << std::endl; 18 | 19 | if (ACA_error_maxgetidx()); 24 | + std::ofstream os(fname); 25 | os << n1 << ' ' << n2 << ' ' << i0 << std::endl; 26 | os.precision(16); 27 | for (unsigned i=0; irankmax) maxk = rankmax; 31 | 32 | + // std::cout << "Approximating block #" << bl->getidx() << std::endl; 33 | + 34 | mbl = new mblock(n1, n2); 35 | assert(mbl!=NULL); 36 | 37 | @@ -159,6 +165,8 @@ 38 | T *U, *V; 39 | 40 | unsigned i0 = bl->getcl1()->geticom() - b1; 41 | + // std::cout << "i0: " << i0 << std::endl; 42 | + 43 | succ = aca_routine(MatGen, b1, n1, b2, n2, eps, maxk, i0, k, U, V, 44 | bl->getcl1(), bl->getcl2()); 45 | 46 | -------------------------------------------------------------------------------- /installer/patches/ahmed_frobenius_norm_ACA.h.patch: -------------------------------------------------------------------------------- 1 | --- Include/ACA.h.w-matgen-patch 2013-02-13 15:44:13.000000000 +0000 2 | +++ Include/ACA.h 2013-02-13 16:50:31.000000000 +0000 3 | @@ -263,7 +263,7 @@ 4 | 5 | sum = (T) 0.0; // update nrms2 6 | for (l=0; l 7 | -void apprx_unsym(MATGEN_T& MatGen, mblock* &mbl, bemblcluster* bl, 8 | +void apprx_unsym_generic( 9 | + bool (*aca_routine)(MATGEN_T&, unsigned, unsigned, unsigned, unsigned, 10 | + double, unsigned, unsigned, unsigned&, T*&, T*&, 11 | + const cluster*, const cluster*), 12 | + MATGEN_T& MatGen, mblock* &mbl, bemblcluster* bl, 13 | double eps, unsigned rankmax) 14 | { 15 | unsigned n1 = bl->getn1(), n2 = bl->getn2(); 16 | @@ -154,7 +158,7 @@ 17 | T *U, *V; 18 | 19 | unsigned i0 = bl->getcl1()->geticom() - b1; 20 | - succ = ::ACA(MatGen, b1, n1, b2, n2, eps, maxk, i0, k, U, V, 21 | + succ = aca_routine(MatGen, b1, n1, b2, n2, eps, maxk, i0, k, U, V, 22 | bl->getcl1(), bl->getcl2()); 23 | 24 | if (succ) { 25 | @@ -173,6 +177,13 @@ 26 | } 27 | } 28 | 29 | +template 30 | +void apprx_unsym(MATGEN_T& MatGen, mblock* &mbl, bemblcluster* bl, 31 | + double eps, unsigned rankmax) 32 | +{ 33 | + apprx_unsym_generic(&ACA, MatGen, mbl, bl, eps, rankmax); 34 | +} 35 | + 36 | // matrix generation procedure for unsymmetric matrices 37 | template 38 | void apprxSVD_unsym(MATGEN_T& MatGen, mblock* &mbl, bemblcluster* bl, 39 | -------------------------------------------------------------------------------- /installer/patches/ahmed_pass_clusters_to_aca_matgen_apprx.h.patch: -------------------------------------------------------------------------------- 1 | --- Include/apprx.h.orig 2012-06-11 15:50:28.000000000 +0100 2 | +++ Include/apprx.h 2012-11-17 14:54:20.000000000 +0000 3 | @@ -34,7 +34,7 @@ 4 | mbl->convLrM_toGeM(A, n1); 5 | T *B = new T[n1*n2]; 6 | 7 | - MatGen.cmpbl(bl->getb1(), n1, bl->getb2(), n2, B); 8 | + MatGen.cmpbl(bl->getb1(), n1, bl->getb2(), n2, B, bl->getcl1(), bl->getcl2()); 9 | 10 | double dnrm = 0.0, dmax = 0.0; 11 | for (unsigned j=0; jgetcl1()->geticom() - b1; 15 | 16 | - succ = ::ACAr(MatGen, b1, n1, b2, n2, eps, maxk, i0, k, U, V); 17 | + succ = ::ACAr(MatGen, b1, n1, b2, n2, eps, maxk, i0, k, U, V, 18 | + bl->getcl1(), bl->getcl2()); 19 | 20 | if (succ) { 21 | mbl->cpyLrM_cmpr(k, U, n1, V, n2, eps, k); 22 | @@ -123,10 +124,10 @@ 23 | if(cmplx_sym) mbl->setSyM(); 24 | else mbl->setHeM(); 25 | 26 | - MatGen.cmpblsym(b1, n1, mbl->getdata()); 27 | + MatGen.cmpblsym(b1, n1, mbl->getdata(), bl->getcl1()); 28 | } else { 29 | mbl->setGeM(); 30 | - MatGen.cmpbl(b1, n1, b2, n2, mbl->getdata()); 31 | + MatGen.cmpbl(b1, n1, b2, n2, mbl->getdata(), bl->getcl1(), bl->getcl2()); 32 | } 33 | } 34 | 35 | @@ -153,7 +154,8 @@ 36 | T *U, *V; 37 | 38 | unsigned i0 = bl->getcl1()->geticom() - b1; 39 | - succ = ::ACA(MatGen, b1, n1, b2, n2, eps, maxk, i0, k, U, V); 40 | + succ = ::ACA(MatGen, b1, n1, b2, n2, eps, maxk, i0, k, U, V, 41 | + bl->getcl1(), bl->getcl2()); 42 | 43 | if (succ) { 44 | mbl->cpyLrM_cmpr(k, U, n1, V, n2, eps, k); 45 | @@ -167,7 +169,7 @@ 46 | 47 | if (!succ) { 48 | mbl->setGeM(); 49 | - MatGen.cmpbl(b1, n1, b2, n2, mbl->getdata()); 50 | + MatGen.cmpbl(b1, n1, b2, n2, mbl->getdata(), bl->getcl1(), bl->getcl2()); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /installer/patches/ahmed_permuted_indices_bemcluster.h.patch: -------------------------------------------------------------------------------- 1 | --- Include/bemcluster.h 2013-02-13 17:16:37.000000000 +0000 2 | +++ Include/bemcluster.h.permuted 2013-02-13 17:16:27.000000000 +0000 3 | @@ -25,25 +25,26 @@ 4 | bemcluster(T* dofs, unsigned* op_perm, unsigned k, unsigned l) : cluster3d_pca(dofs, op_perm, k, l) 5 | { 6 | // compute icom 7 | - icom = this -> nbeg; 8 | + icom = op_perm[this->nbeg]; // original index. Will be replaced by permuted 9 | + // index in createClusterTree() 10 | 11 | const unsigned n = cluster3d_pca::dim(); 12 | unsigned i, j; 13 | 14 | double smin = 0.0; 15 | for (j=0; j::getcom(j) - dofs[this->nbeg].getcenter(j); 17 | + const double e = cluster3d_pca::getcom(j) - dofs[op_perm[this->nbeg]].getcenter(j); 18 | smin += e*e; 19 | } 20 | 21 | for (i=this->nbeg+1; inend; ++i) { 22 | double s = 0.0; 23 | for (j=0; j::getcom(j) - dofs[i].getcenter(j); 25 | + const double e = cluster3d_pca::getcom(j) - dofs[op_perm[i]].getcenter(j); 26 | s += e*e; 27 | } 28 | if (s::createClusterTree(bmin, op_perm, po_perm); 45 | + icom = po_perm[icom]; 46 | + } 47 | }; 48 | 49 | 50 | -------------------------------------------------------------------------------- /installer/patches/ahmed_total_pivot_count_apprx.h.patch: -------------------------------------------------------------------------------- 1 | --- apprx.h.debug-messages 2013-02-13 17:13:05.000000000 +0000 2 | +++ apprx.h.total_pivot_count 2013-02-13 17:11:53.000000000 +0000 3 | @@ -20,6 +20,10 @@ 4 | #include "bemblcluster.h" 5 | #include "ACA.h" 6 | 7 | +#include 8 | + 9 | +tbb::atomic total_pivot_count; 10 | + 11 | #ifdef CHECK_ACA_ERROR 12 | 13 | double ACA_error_max = 0.0; 14 | @@ -169,6 +173,7 @@ 15 | 16 | succ = aca_routine(MatGen, b1, n1, b2, n2, eps, maxk, i0, k, U, V, 17 | bl->getcl1(), bl->getcl2()); 18 | + total_pivot_count += k; 19 | 20 | if (succ) { 21 | mbl->cpyLrM_cmpr(k, U, n1, V, n2, eps, k); 22 | -------------------------------------------------------------------------------- /installer/patches/ahmed_zero_pu_pv_ACA.h.patch: -------------------------------------------------------------------------------- 1 | --- Include/ACA.h.frobenius-norm 2013-02-13 16:50:31.000000000 +0000 2 | +++ Include/ACA.h 2013-02-13 16:48:46.000000000 +0000 3 | @@ -97,7 +97,8 @@ 4 | const T e = (pv[l] *= sca); 5 | nrmv2 += abs2(e); 6 | if (abs(e) > 1e-8*scale*sqrtpiv) ++S[l]; // col l will be succ. approx 7 | - } 8 | + } else 9 | + pv[l] = 0.; 10 | } 11 | 12 | MatGen.cmpbl(b1, n1, b2+j0, 1, pu, c1, c2); 13 | @@ -179,7 +183,8 @@ 14 | const T e = (pu[l] *= sca); 15 | nrmu2 += abs2(e); 16 | if (abs(e) > 1e-8 * scale*sqrtpiv) ++Z[l]; 17 | - } 18 | + } else 19 | + pu[l] = 0.; 20 | } 21 | 22 | MatGen.cmpbl(b1+i0, 1, b2, n2, pv, c1, c2); 23 | -------------------------------------------------------------------------------- /installer/patches/armadillo_config.patch: -------------------------------------------------------------------------------- 1 | --- ./config.hpp 2012-05-14 08:28:41.000000000 +0100 2 | +++ ./config.new.hpp 2012-05-20 17:03:24.000000000 +0100 3 | @@ -13,14 +13,14 @@ 4 | 5 | 6 | #if !defined(ARMA_USE_LAPACK) 7 | -// #define ARMA_USE_LAPACK 8 | +#define ARMA_USE_LAPACK 9 | //// Uncomment the above line if you have LAPACK or a high-speed replacement for LAPACK, 10 | //// such as Intel's MKL, AMD's ACML, or the Accelerate framework. 11 | //// LAPACK is required for matrix decompositions (eg. SVD) and matrix inverse. 12 | #endif 13 | 14 | #if !defined(ARMA_USE_BLAS) 15 | -// #define ARMA_USE_BLAS 16 | +#define ARMA_USE_BLAS 17 | //// Uncomment the above line if you have BLAS or a high-speed replacement for BLAS, 18 | //// such as GotoBLAS, Intel's MKL, AMD's ACML, or the Accelerate framework. 19 | //// BLAS is used for matrix multiplication. 20 | -------------------------------------------------------------------------------- /installer/patches/cmake/dune-common.cmake: -------------------------------------------------------------------------------- 1 | configure_file( 2 | ${CMAKE_CURRENT_SOURCE_DIR}/config.h.in 3 | ${CMAKE_BINARY_DIR}/include/dune/common/config.h) 4 | 5 | include_directories(${CMAKE_BINARY_DIR}/include/dune/common) 6 | 7 | 8 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}) 9 | 10 | add_library(dunecommon SHARED 11 | ${CMAKE_CURRENT_SOURCE_DIR}/dune/common/configparser.cc 12 | ${CMAKE_CURRENT_SOURCE_DIR}/dune/common/exceptions.cc 13 | ${CMAKE_CURRENT_SOURCE_DIR}/dune/common/ios_state.cc 14 | ${CMAKE_CURRENT_SOURCE_DIR}/dune/common/parametertree.cc 15 | ${CMAKE_CURRENT_SOURCE_DIR}/dune/common/parametertreeparser.cc 16 | ${CMAKE_CURRENT_SOURCE_DIR}/dune/common/path.cc 17 | ${CMAKE_CURRENT_SOURCE_DIR}/dune/common/stdstreams.cc 18 | ) 19 | set_target_properties(dunecommon PROPERTIES LINKER_LANGUAGE CXX) 20 | 21 | install(TARGETS dunecommon 22 | LIBRARY DESTINATION lib 23 | ARCHIVE DESTINATION lib) 24 | 25 | -------------------------------------------------------------------------------- /installer/patches/cmake/dune-foamgrid.cmake: -------------------------------------------------------------------------------- 1 | configure_file( 2 | ${CMAKE_CURRENT_SOURCE_DIR}/config.h.in 3 | ${CMAKE_BINARY_DIR}/include/dune/foamgrid/config.h) 4 | 5 | include_directories(${CMAKE_BINARY_DIR}/include/dune/foamgrid) 6 | 7 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}) 8 | 9 | -------------------------------------------------------------------------------- /installer/patches/cmake/dune-grid.cmake: -------------------------------------------------------------------------------- 1 | configure_file( 2 | ${CMAKE_CURRENT_SOURCE_DIR}/config.h.in 3 | ${CMAKE_BINARY_DIR}/include/dune/grid/config.h) 4 | 5 | include_directories(${CMAKE_BINARY_DIR}/include/dune/grid) 6 | 7 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}) 8 | file(GLOB QUADRATURERULES_LIB_SOURCES 9 | ${CMAKE_CURRENT_SOURCE_DIR}/dune/grid/common/quadraturerules/*.cc) 10 | file(GLOB ONEDGRID_LIB_SOURCES 11 | ${CMAKE_CURRENT_SOURCE_DIR}/dune/grid/onedgrid/*.cc) 12 | 13 | set(DGFPARSER_LIB_SOURCES 14 | ${CMAKE_CURRENT_SOURCE_DIR}/dune/grid/io/file/dgfparser/dgfparserblocks.cc 15 | ${CMAKE_CURRENT_SOURCE_DIR}/dune/grid/io/file/dgfparser/dgfprojectionblock.cc 16 | ${CMAKE_CURRENT_SOURCE_DIR}/dune/grid/io/file/dgfparser/dgfparser.cc 17 | ) 18 | 19 | add_library(dunegrid SHARED 20 | ${QUADRATURERULES_LIB_SOURCES} 21 | ${ONEDGRID_LIB_SOURCES} 22 | ${DGFPARSER_LIB_SOURCES} 23 | ) 24 | 25 | 26 | #set_target_properties(quadraturerules PROPERTIES LINKER_LANGUAGE CXX) 27 | 28 | target_link_libraries(dunegrid dunecommon) 29 | 30 | install(TARGETS dunegrid 31 | LIBRARY DESTINATION lib 32 | ARCHIVE DESTINATION lib) 33 | 34 | -------------------------------------------------------------------------------- /installer/patches/cmake/dune-localfunctions.cmake: -------------------------------------------------------------------------------- 1 | configure_file( 2 | ${CMAKE_CURRENT_SOURCE_DIR}/config.h.in 3 | ${CMAKE_BINARY_DIR}/include/dune/localfunctions/config.h) 4 | 5 | include_directories(${CMAKE_BINARY_DIR}/include/dune/localfunctions) 6 | 7 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}) 8 | 9 | -------------------------------------------------------------------------------- /installer/patches/dune-foamgrid/foamgrid-comm.patch: -------------------------------------------------------------------------------- 1 | --- foamgrid.hh.old 2011-11-22 13:19:05.000000000 +0000 2 | +++ foamgrid.hh 2011-11-22 15:46:03.000000000 +0000 3 | @@ -408,13 +408,11 @@ 4 | {} 5 | #endif 6 | 7 | -#if 0 8 | /** dummy collective communication */ 9 | - const CollectiveCommunication& comm () const 10 | + const typename Traits::CollectiveCommunication& comm () const 11 | { 12 | return ccobj_; 13 | } 14 | -#endif 15 | /*@}*/ 16 | 17 | 18 | @@ -446,10 +444,10 @@ 19 | // IdSets don't need updating 20 | 21 | } 22 | -#if 0 23 | - //! \todo Please doc me ! 24 | - CollectiveCommunication ccobj_; 25 | -#endif 26 | + 27 | + //! Collective communication interface 28 | + typename Traits::CollectiveCommunication ccobj_; 29 | + 30 | // Stores the lists of vertices, edges, elements for each level 31 | std::vector >, 32 | std::list >, 33 | -------------------------------------------------------------------------------- /installer/patches/dune-foamgrid/foamgrid-setindices.patch: -------------------------------------------------------------------------------- 1 | --- foamgrid.hh.old 2011-11-22 13:15:30.000000000 +0000 2 | +++ foamgrid.hh 2011-11-22 13:19:05.000000000 +0000 3 | @@ -452,8 +452,8 @@ 4 | #endif 5 | // Stores the lists of vertices, edges, elements for each level 6 | std::vector >, 7 | - std::list>, 8 | - std::list> > > entityImps_; 9 | + std::list >, 10 | + std::list > > > entityImps_; 11 | 12 | //! Our set of level indices 13 | std::vector*> levelIndexSets_; 14 | -------------------------------------------------------------------------------- /installer/patches/dune-foamgrid/foamgridentityimp-assignment-operator.patch: -------------------------------------------------------------------------------- 1 | --- ./foamgridentity.hh 2011-09-13 15:39:25.000000000 +0200 2 | +++ ./foamgridentity_new.hh 2011-11-20 22:18:58.000000000 +0100 3 | @@ -146,7 +146,17 @@ 4 | 5 | const FoamGridEntityImp* target_; 6 | 7 | - 8 | + 9 | + FoamGridEntity& operator=(const FoamGridEntity& original) 10 | + { 11 | + if (this != &original) 12 | + { 13 | + geo_.reset(); 14 | + target_ = original.target_; 15 | + } 16 | + return *this; 17 | + } 18 | + 19 | private: 20 | 21 | //! \todo Please doc me ! 22 | -------------------------------------------------------------------------------- /installer/patches/dune-foamgrid/foamgridfactory-insertboundarysegment.patch: -------------------------------------------------------------------------------- 1 | --- foamgridfactory.hh.old 2011-11-22 13:23:59.000000000 +0000 2 | +++ foamgridfactory.hh 2011-11-22 13:24:27.000000000 +0000 3 | @@ -108,7 +108,7 @@ 4 | Currently, the BoundarySegment object does not actually have any effect. 5 | */ 6 | virtual void insertBoundarySegment(const std::vector& vertices, 7 | - const shared_ptr > boundarySegment) 8 | + const shared_ptr > boundarySegment) 9 | { 10 | insertBoundarySegment(vertices); 11 | } 12 | -------------------------------------------------------------------------------- /installer/patches/dune-grid.patch: -------------------------------------------------------------------------------- 1 | --- ./structuredgridfactory.hh 2011-01-24 13:33:37.000000000 +0000 2 | +++ ./structuredgridfactory_new.hh 2011-11-17 23:17:54.000000000 +0000 3 | @@ -81,8 +81,8 @@ 4 | 5 | /** \brief Insert a structured set of vertices into the factory */ 6 | static void insertVertices(GridFactory& factory, 7 | - const FieldVector& lowerLeft, 8 | - const FieldVector& upperRight, 9 | + const FieldVector& lowerLeft, 10 | + const FieldVector& upperRight, 11 | const array& vertices) 12 | { 13 | 14 | -------------------------------------------------------------------------------- /installer/patches/dune-localfunctions_raviartthomas.patch: -------------------------------------------------------------------------------- 1 | --- raviartthomas02dlocalbasis.hh.orig 2012-11-12 16:28:48.000000000 +0000 2 | +++ raviartthomas02dlocalbasis.hh 2012-12-29 12:42:47.000000000 +0000 3 | @@ -48,8 +48,9 @@ 4 | std::vector& out) const 5 | { 6 | out.resize(3); 7 | - out[0][0] = sign0*in[0]; out[0][1]=sign0*(in[1]-1.0); 8 | - out[1][0] = sign1*(in[0]-1.0); out[1][1]=sign1*in[1]; 9 | + const D one = 1.0; 10 | + out[0][0] = sign0*in[0]; out[0][1]=sign0*(in[1]-one); 11 | + out[1][0] = sign1*(in[0]-one); out[1][1]=sign1*in[1]; 12 | out[2][0] = sign2*in[0]; out[2][1]=sign2*in[1]; 13 | } 14 | 15 | -------------------------------------------------------------------------------- /installer/patches/thyra_static_initialization_order.patch: -------------------------------------------------------------------------------- 1 | --- Thyra_DirectionalFiniteDiffCalculator_decl.hpp.orig 2012-10-09 13:39:02.000000000 +0100 2 | +++ Thyra_DirectionalFiniteDiffCalculator_decl.hpp 2012-10-09 13:20:23.000000000 +0100 3 | @@ -262,13 +262,13 @@ 4 | static const std::string FDMethod_default; 5 | 6 | static const std::string FDStepSelectType_name; 7 | - static const RCP > 8 | - fdStepSelectTypeValidator; 9 | static const std::string FDStepSelectType_default; 10 | 11 | static const std::string FDStepLength_name; 12 | static const double FDStepLength_default; 13 | 14 | + static const RCP > 15 | + fdStepSelectTypeValidator; 16 | }; 17 | 18 | 19 | -------------------------------------------------------------------------------- /installer/patches/trilinos_find_python_interp.patch: -------------------------------------------------------------------------------- 1 | --- ./FindPythonInterp.cmake 2013-02-13 11:20:26.327587753 +0000 2 | +++ ./FindPythonInterp.cmake.new 2013-02-13 10:26:36.268562383 +0000 3 | @@ -115,7 +115,7 @@ 4 | ERROR_STRIP_TRAILING_WHITESPACE 5 | ) 6 | SEPARATE_ARGUMENTS(PythonInterp_VERSION) 7 | - LIST(GET PythonInterp_VERSION -1 PythonInterp_VERSION) 8 | + LIST(GET PythonInterp_VERSION 1 PythonInterp_VERSION) 9 | IF(${PythonInterp_VERSION} VERSION_LESS ${PythonInterp_FIND_VERSION}) 10 | MESSAGE(WARNING 11 | "Python version ${PythonInterp_VERSION}" 12 | -------------------------------------------------------------------------------- /installer/py_modules/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UCL/bempp/f768ec7d319c02d6e0142512fb61db0607cadf10/installer/py_modules/__init__.py -------------------------------------------------------------------------------- /installer/py_modules/configuration.py: -------------------------------------------------------------------------------- 1 | #Copyright (C) 2011 by the BEM++ Authors 2 | # 3 | #Permission is hereby granted, free of charge, to any person obtaining a copy 4 | #of this software and associated documentation files (the "Software"), to deal 5 | #in the Software without restriction, including without limitation the rights 6 | #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | #copies of the Software, and to permit persons to whom the Software is 8 | #furnished to do so, subject to the following conditions: 9 | # 10 | #The above copyright notice and this permission notice shall be included in 11 | #all copies or substantial portions of the Software. 12 | # 13 | #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | #THE SOFTWARE. 20 | 21 | # This script downloads necessary third party libraries, which are needed for BEM++ 22 | 23 | import os 24 | 25 | class ConfigureBuild: 26 | 27 | def __init__(self,root): 28 | self.root=root # root is the path of the bempp source directory 29 | 30 | def readConfig(self,fname): 31 | from ConfigParser import ConfigParser 32 | self.config = ConfigParser() 33 | self.config.read(fname) 34 | 35 | 36 | 37 | 38 | if __name__ == "__main__": 39 | root="/Users/tbetcke/git/bempp" 40 | config = ConfigureBuild(root) 41 | config.readConfig(root+"/bempp.cfg") 42 | config.writeOptions() 43 | 44 | 45 | -------------------------------------------------------------------------------- /lib/assembly/aca_options.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2012 by the BEM++ Authors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #include "aca_options.hpp" 22 | #include 23 | 24 | namespace Bempp 25 | { 26 | 27 | AcaOptions::AcaOptions() : 28 | eps(1E-4), 29 | eta(1.2), 30 | minimumBlockSize(16), 31 | maximumBlockSize(std::numeric_limits::max()), 32 | maximumRank(std::numeric_limits::max()), 33 | globalAssemblyBeforeCompression(true), 34 | recompress(false), 35 | outputPostscript(false), 36 | outputFname("aca.ps"), 37 | scaling(1.0), 38 | useAhmedAca(false) 39 | { 40 | } 41 | 42 | } // namespace Bempp 43 | -------------------------------------------------------------------------------- /lib/assembly/function.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2012 by the BEM++ Authors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #ifndef bempp_function_hpp 22 | #define bempp_function_hpp 23 | 24 | #include "../fiber/function.hpp" 25 | 26 | namespace Bempp 27 | { 28 | 29 | using Fiber::Function; 30 | 31 | } // namespace Bempp 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /lib/assembly/helmholtz_3d_operators_common.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2012 by the BEM++ Authors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #ifndef bempp_helmholtz_3d_operators_common_hpp 22 | #define bempp_helmholtz_3d_operators_common_hpp 23 | 24 | namespace Bempp 25 | { 26 | 27 | const int DEFAULT_HELMHOLTZ_INTERPOLATION_DENSITY = 5000; 28 | 29 | } // namespace Bempp 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /lib/assembly/symmetry.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2012 by the BEM++ Authors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #ifndef bempp_symmetry_hpp 22 | #define bempp_symmetry_hpp 23 | 24 | #include "../common/common.hpp" 25 | 26 | namespace Bempp 27 | { 28 | 29 | /** \ingroup weak_form_assembly 30 | * \brief Set of constants describing the symmetry of an operator. 31 | */ 32 | enum Symmetry 33 | { 34 | NO_SYMMETRY = 0x0000, 35 | SYMMETRIC = 0x0001, 36 | HERMITIAN = 0x0002, 37 | AUTO_SYMMETRY = 0x8000 38 | }; 39 | 40 | } // namespace Bempp 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /lib/common/armadillo_fwd.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2012 by the BEM++ Authors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | 22 | #ifndef bempp_armadillo_fwd_hpp 23 | #define bempp_armadillo_fwd_hpp 24 | 25 | // Disable diagnostic 2089: definition of base class type not completed yet 26 | // Disable diagnostic 488: entity-kind "entity" is not used in declaring the 27 | // parameter types of entity-kind "entity" 28 | 29 | #ifdef __INTEL_COMPILER 30 | #pragma warning(disable:2089 488) 31 | #endif 32 | 33 | #include 34 | 35 | #ifdef __INTEL_COMPILER 36 | #pragma warning(default:2089 488) 37 | #endif 38 | 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /lib/common/boost_make_shared_fwd.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2012 by the BEM++ Authors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | 22 | #ifndef bempp_boost_make_shared_fwd_hpp 23 | #define bempp_boost_make_shared_fwd_hpp 24 | 25 | // Disable diagnostic 279: controlling expression is constant 26 | // Disable diagnostic 858: type qualifier on return type is meaningless 27 | 28 | #ifdef __INTEL_COMPILER 29 | #pragma warning(disable:279 858) 30 | #endif 31 | 32 | #include 33 | 34 | #ifdef __INTEL_COMPILER 35 | #pragma warning(default:858) 36 | #endif 37 | 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /lib/common/boost_ptr_map_fwd.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2012 by the BEM++ Authors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | 22 | #ifndef bempp_boost_ptr_map_fwd_hpp 23 | #define bempp_boost_ptr_map_fwd_hpp 24 | 25 | // Disable diagnostic 279: controlling expression is constant 26 | // Disable diagnostic 858: type qualifier on return type is meaningless 27 | 28 | #ifdef __INTEL_COMPILER 29 | #pragma warning(disable:279 858) 30 | #endif 31 | 32 | #include 33 | 34 | #ifdef __INTEL_COMPILER 35 | #pragma warning(default:858) 36 | #endif 37 | 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /lib/common/boost_ptr_vector_fwd.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2012 by the BEM++ Authors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | 22 | #ifndef bempp_boost_ptr_vector_fwd_hpp 23 | #define bempp_boost_ptr_vector_fwd_hpp 24 | 25 | // Disable diagnostic 279: controlling expression is constant 26 | // Disable diagnostic 858: type qualifier on return type is meaningless 27 | 28 | #ifdef __INTEL_COMPILER 29 | #pragma warning(disable:279 858) 30 | #endif 31 | 32 | #include 33 | 34 | #ifdef __INTEL_COMPILER 35 | #pragma warning(default:858) 36 | #endif 37 | 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /lib/common/boost_scoped_array_fwd.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2012 by the BEM++ Authors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | 22 | #ifndef bempp_boost_scoped_array_fwd_hpp 23 | #define bempp_boost_scoped_array_fwd_hpp 24 | 25 | // Disable diagnostic 279: controlling expression is constant 26 | // Disable diagnostic 858: type qualifier on return type is meaningless 27 | 28 | #ifdef __INTEL_COMPILER 29 | #pragma warning(disable:279 858) 30 | #endif 31 | 32 | #include 33 | 34 | #ifdef __INTEL_COMPILER 35 | #pragma warning(default:858) 36 | #endif 37 | 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /lib/common/boost_shared_array_fwd.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2012 by the BEM++ Authors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | 22 | #ifndef bempp_boost_shared_array_fwd_hpp 23 | #define bempp_boost_shared_array_fwd_hpp 24 | 25 | // Disable diagnostic 279: controlling expression is constant 26 | // Disable diagnostic 858: type qualifier on return type is meaningless 27 | 28 | #ifdef __INTEL_COMPILER 29 | #pragma warning(disable:279 858) 30 | #endif 31 | 32 | #include 33 | 34 | #ifdef __INTEL_COMPILER 35 | #pragma warning(default:858) 36 | #endif 37 | 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /lib/common/chunk_statistics.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2012 by the BEM++ Authors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #ifndef bempp_chunk_statistics_hpp 22 | #define bempp_chunk_statistics_hpp 23 | 24 | #include 25 | 26 | namespace Bempp 27 | { 28 | 29 | /** \brief Storage of parallel-loop profiling data. */ 30 | struct ChunkStatistics 31 | { 32 | ChunkStatistics() : valid(false) {} 33 | bool valid; 34 | size_t chunkStart; 35 | size_t chunkSize; 36 | tbb::tick_count startTime; 37 | tbb::tick_count endTime; 38 | }; 39 | 40 | } // namespace Bempp 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /lib/common/common.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2012 by the BEM++ Authors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | 22 | #ifndef bempp_common_hpp 23 | #define bempp_common_hpp 24 | 25 | #ifdef __INTEL_COMPILER 26 | #pragma warning(disable:279 186 858 262 1011 654 597) 27 | #endif 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /lib/common/config_ahmed.hpp.in: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2012 by the BEM++ Authors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #ifndef bempp_config_ahmed_hpp 22 | #define bempp_config_ahmed_hpp 23 | 24 | #cmakedefine WITH_AHMED 25 | 26 | // Uncomment if AHMED was compiled with STD_CMPLX defined 27 | #define AHMED_USES_STD_COMPLEX 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /lib/common/config_alugrid.hpp.in: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2012 by the BEM++ Authors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #ifndef bempp_config_alugrid_hpp 22 | #define bempp_config_alugrid_hpp 23 | 24 | #cmakedefine WITH_ALUGRID 25 | #ifdef WITH_ALUGRID 26 | #define HAVE_ALUGRID 1 27 | #define ENABLE_ALUGRID 1 28 | #endif 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /lib/common/config_blas_and_lapack.hpp.in: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2012 by the BEM++ Authors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #ifndef bempp_config_blas_and_lapack_hpp 22 | #define bempp_config_blas_and_lapack_hpp 23 | 24 | #cmakedefine WITH_MKL 25 | #cmakedefine WITH_GOTOBLAS 26 | #cmakedefine WITH_OPENBLAS 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /lib/common/config_data_types.hpp.in: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2012 by the BEM++ Authors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #ifndef bempp_config_data_types_hpp 22 | #define bempp_config_data_types_hpp 23 | 24 | #cmakedefine ENABLE_SINGLE_PRECISION 25 | #cmakedefine ENABLE_DOUBLE_PRECISION 26 | #cmakedefine ENABLE_COMPLEX_KERNELS 27 | #cmakedefine ENABLE_COMPLEX_BASIS_FUNCTIONS 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /lib/common/config_opencl.hpp.in: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2012 by the BEM++ Authors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #ifndef bempp_config_opencl_hpp 22 | #define bempp_config_opencl_hpp 23 | 24 | #cmakedefine WITH_OPENCL 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /lib/common/config_trilinos.hpp.in: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2012 by the BEM++ Authors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #ifndef config_trilinos_hpp 22 | #define config_trilinos_hpp 23 | 24 | #define WITH_TRILINOS 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /lib/common/multidimensional_arrays.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2012 by the BEM++ Authors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #ifndef bempp_multidimensional_arrays_hpp 22 | #define bempp_multidimensional_arrays_hpp 23 | 24 | #include "../fiber/_2d_array.hpp" 25 | #include "../fiber/_3d_array.hpp" 26 | #include "../fiber/_4d_array.hpp" 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /lib/common/scalar_traits.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011 by the BEM++ Authors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #ifndef bempp_scalar_traits_hpp 22 | #define bempp_scalar_traits_hpp 23 | 24 | #include "../fiber/scalar_traits.hpp" 25 | 26 | namespace Bempp 27 | { 28 | 29 | using Fiber::ScalarTraits; 30 | using Fiber::Coercion; 31 | 32 | } // namespace Bempp 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /lib/common/shared_ptr.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2012 by the BEM++ Authors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #ifndef bempp_shared_ptr_hpp 22 | #define bempp_shared_ptr_hpp 23 | 24 | #include "../fiber/shared_ptr.hpp" 25 | 26 | namespace Bempp 27 | { 28 | 29 | using Fiber::shared_ptr; 30 | using Fiber::make_shared_from_ref; 31 | using Fiber::make_shared_from_const_ref; 32 | using Fiber::null_deleter; 33 | using Fiber::dynamic_pointer_cast; 34 | 35 | } // namespace Bempp 36 | 37 | #endif // bempp_shared_ptr_hpp 38 | -------------------------------------------------------------------------------- /lib/common/stl_io.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2012 by the BEM++ Authors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | 22 | #ifndef bempp_stl_io_hpp 23 | #define bempp_stl_io_hpp 24 | 25 | #include 26 | #include 27 | 28 | template 29 | std::ostream& operator<< (std::ostream& dest, const std::vector& v) 30 | { 31 | for (int i = 0; i < v.size(); ++i) 32 | dest << v[i] << '\n'; 33 | dest.flush(); 34 | return dest; 35 | } 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /lib/common/to_string.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2012 by the BEM++ Authors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #ifndef bempp_to_string_hpp 22 | #define bempp_to_string_hpp 23 | 24 | #include 25 | #include 26 | 27 | namespace Bempp 28 | { 29 | 30 | template 31 | inline std::string toString(const Source& arg) 32 | { 33 | return boost::lexical_cast(arg); 34 | } 35 | 36 | } // namespace Bempp 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /lib/fiber/CL/commontypes.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMMONTYPES_H 2 | #define __COMMONTYPES_H 3 | 4 | typedef struct { 5 | int dim; 6 | int nvtx; 7 | int nels; 8 | int nidx; 9 | } MeshParam; 10 | 11 | typedef struct { // see opencl_framework.hpp for details 12 | int dim; 13 | int nvtx; 14 | int nels; 15 | int nidx; 16 | __global const ValueType *cl_vtxbuf; 17 | __global const int *cl_elbuf; 18 | } MeshGeom; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /lib/fiber/CL/laplace_3d_adjoint_double_layer_potential_kernel.cl: -------------------------------------------------------------------------------- 1 | // -*-C++-*- 2 | 3 | /** 4 | * \file laplace_3d_adjoint_double_layer_potential_kernel.cl 5 | * OpenCL implementation for adjoint double layer potential kernel evaluation 6 | */ 7 | 8 | /** 9 | * \brief Adjoint double layer potential evaluation for a single point pair 10 | * \param testPoint test point coordinates 11 | * \param trialPoint trial point coordinates 12 | * \param trialNormal, normals at trial points 13 | * \param coordCount number of coordinates for each point 14 | * \note testPoint and trialPoint must be of size coordCount 15 | */ 16 | ValueType devKerneval (const ValueType *testPoint, 17 | const ValueType *trialPoint, 18 | const ValueType *testNormal, 19 | int coordCount) 20 | { 21 | int k; 22 | ValueType diff, distance, denominatorSum, numeratorSum; 23 | denominatorSum = 0; 24 | numeratorSum = 0; 25 | for (k = 0; k < coordCount; k++) { 26 | diff = testPoint[k] - trialPoint[k]; 27 | denominatorSum += diff * diff; 28 | numeratorSum += diff * testNormal[k]; 29 | } 30 | distance = sqrt (denominatorSum); 31 | return -numeratorSum / (4.0 * M_PI * distance * distance * distance); 32 | } 33 | -------------------------------------------------------------------------------- /lib/fiber/CL/laplace_3d_double_layer_potential_kernel.cl: -------------------------------------------------------------------------------- 1 | // -*-C++-*- 2 | 3 | /** 4 | * \file laplace_3d_double_layer_potential_kernel.cl 5 | * OpenCL implementation for double layer potential kernel evaluation 6 | */ 7 | 8 | /** 9 | * \brief Double layer potential evaluation for a single point pair 10 | * \param testPoint test point coordinates 11 | * \param trialPoint trial point coordinates 12 | * \param trialNormal components of the vector normal to the surface at trial point 13 | * \param coordCount number of coordinates for each point 14 | * \note testPoint, trialPoint and trialNormal must be of size coordCount 15 | */ 16 | ValueType devKerneval (const ValueType *testPoint, 17 | const ValueType *trialPoint, 18 | const ValueType *trialNormal, 19 | int coordCount) 20 | { 21 | int k; 22 | ValueType diff, distance, denominatorSum, numeratorSum; 23 | denominatorSum = 0; 24 | numeratorSum = 0; 25 | for (k = 0; k < coordCount; k++) { 26 | diff = trialPoint[k] - testPoint[k]; 27 | denominatorSum += diff * diff; 28 | numeratorSum += diff * trialNormal[k]; 29 | } 30 | distance = sqrt (denominatorSum); 31 | return -numeratorSum / (4.0 * M_PI * distance * distance * distance); 32 | } 33 | -------------------------------------------------------------------------------- /lib/fiber/CL/mkclinc.sh: -------------------------------------------------------------------------------- 1 | # Strip comments and dereference includes 2 | # Note that we need to create an intermediate file so that xxd can 3 | # generate its full output 4 | #cpp -P $1 /tmp/$1 5 | 6 | # Create the include file containing the character array and array length 7 | # Replace 'unsigned' with 'const' 8 | #xxd -i /tmp/$1 - | sed -e s/unsigned/const/ -e s/_tmp_//g > $1.str 9 | 10 | xxd -i $1 - | sed -e s/unsigned/const/ > $1.str 11 | -------------------------------------------------------------------------------- /lib/fiber/CL/scalar_function_value.cl: -------------------------------------------------------------------------------- 1 | /** 2 | * \brief Evaluate linear basis function on a reference triangle 3 | * \param [in] p pointer to reference point 4 | * \param [out] bf array of basis function values [3] 5 | * \note Definition of reference triangle: v = {{0,0,0},{1,0,0},{0,1,0}} 6 | * \note z-coordinates of all input points must be 0 7 | */ 8 | void devExpressionEvaluate (const ValueType *basisData, 9 | ValueType *result, 10 | int n) 11 | { 12 | for (int i = 0; i < n; i++) 13 | result[i] = basisData[i]; 14 | } 15 | -------------------------------------------------------------------------------- /lib/fiber/cl_util.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2012 by the BEM++ Authors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | //from http://www.songho.ca/opengl/gl_vbo.html 22 | 23 | #ifndef ADVCL_UTIL_H_INCLUDED 24 | #define ADVCL_UTIL_H_INCLUDED 25 | 26 | #include "../common/common.hpp" 27 | 28 | char *file_contents(const char *filename, int *length); 29 | 30 | const char* oclErrorString(cl_int error); 31 | 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /lib/fiber/conjugate.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2012 by the BEM++ Authors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #ifndef fiber_conjugate_hpp 22 | #define fiber_conjugate_hpp 23 | 24 | #include "../common/common.hpp" 25 | 26 | 27 | #include 28 | 29 | namespace Fiber 30 | { 31 | 32 | inline float conjugate(float x) 33 | { 34 | return x; 35 | } 36 | 37 | inline double conjugate(double x) 38 | { 39 | return x; 40 | } 41 | 42 | inline std::complex conjugate(std::complex x) 43 | { 44 | return std::conj(x); 45 | } 46 | 47 | inline std::complex conjugate(std::complex x) 48 | { 49 | return std::conj(x); 50 | } 51 | 52 | } // namespace Fiber 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /lib/fiber/initialize_interpolator_for_modified_helmholtz_3d_kernels.hpp: -------------------------------------------------------------------------------- 1 | #ifndef bempp_initialize_interpolator_for_modified_helmholtz_3d_kernels_hpp 2 | #define bempp_initialize_interpolator_for_modified_helmholtz_3d_kernels_hpp 3 | 4 | #include "../common/common.hpp" 5 | #include "hermite_interpolator.hpp" 6 | 7 | namespace Fiber 8 | { 9 | 10 | template 11 | void initializeInterpolatorForModifiedHelmholtz3dKernels( 12 | ValueType waveNumber, 13 | typename ScalarTraits::RealType maxDist, 14 | int interpPtsPerWavelength, 15 | HermiteInterpolator& interpolator); 16 | 17 | } // namespace Fiber 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /lib/fiber/opencl_options.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2012 by the BEM++ Authors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #ifndef fiber_opencl_options_hpp 22 | #define fiber_opencl_options_hpp 23 | 24 | #include "../common/common.hpp" 25 | 26 | namespace Fiber 27 | { 28 | 29 | struct OpenClOptions 30 | { 31 | OpenClOptions () 32 | { 33 | useOpenCl = true; 34 | } 35 | 36 | bool useOpenCl; 37 | // add more as required 38 | }; 39 | 40 | } 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /lib/fiber/serial_blas_region.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2012 by the BEM++ Authors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #ifndef bempp_serial_blas_region_hpp 22 | #define bempp_serial_blas_region_hpp 23 | 24 | #include "../common/common.hpp" 25 | 26 | namespace Fiber 27 | { 28 | 29 | /** \brief Management of the number of threads used by BLAS and LAPACK. */ 30 | class SerialBlasRegion 31 | { 32 | public: 33 | /** \brief Make BLAS and LAPACK use only 1 thread. */ 34 | SerialBlasRegion(); 35 | /** \brief Restore the original number of threads used by BLAS and LAPACK. */ 36 | ~SerialBlasRegion(); 37 | 38 | private: 39 | int m_originalThreadCount; 40 | }; 41 | 42 | } // namespace Fiber 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /lib/fiber/types.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2012 by the BEM++ Authors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #ifndef fiber_types_hpp 22 | #define fiber_types_hpp 23 | 24 | #include "../common/common.hpp" 25 | 26 | namespace Fiber 27 | { 28 | 29 | enum CallVariant 30 | { 31 | TEST_TRIAL = 0, 32 | TRIAL_TEST = 1 33 | }; 34 | 35 | typedef int LocalDofIndex; 36 | const LocalDofIndex ALL_DOFS = -1; 37 | 38 | } 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /lib/fiber/verbosity_level.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2012 by the BEM++ Authors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #ifndef fiber_verbosity_level_hpp 22 | #define fiber_verbosity_level_hpp 23 | 24 | #include "../common/common.hpp" 25 | 26 | namespace Fiber 27 | { 28 | 29 | /** \brief Verbosity level. */ 30 | struct VerbosityLevel { 31 | enum Level { 32 | DEFAULT = 0, 33 | HIGH = 5, 34 | LOW = -5 35 | }; 36 | }; 37 | 38 | } // namespace Fiber 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /lib/grid/dune.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2012 by the BEM++ Authors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #ifndef bempp_dune_hpp 22 | #define bempp_dune_hpp 23 | 24 | #include "../common/common.hpp" 25 | 26 | #include "bempp/common/config_alugrid.hpp" 27 | 28 | #include 29 | #include // fix a bug in foamgrid -- this header is not included where it should be 30 | #include 31 | #ifdef WITH_ALUGRID 32 | #include 33 | #endif 34 | 35 | namespace Bempp 36 | { 37 | typedef Dune::FoamGrid<3 /* dimWorld */> Default2dIn3dDuneGrid; 38 | #ifdef WITH_ALUGRID 39 | typedef Dune::ALUSimplexGrid<3 /*dimGrid */, 3 /* dimWorld */> Default3dIn3dDuneGrid; 40 | #endif 41 | } // namespace Bempp 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /lib/grid/geometry_factory.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2012 by the BEM++ Authors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #ifndef bempp_geometry_factory_hpp 22 | #define bempp_geometry_factory_hpp 23 | 24 | #include "../common/common.hpp" 25 | 26 | #include "bempp/common/config_alugrid.hpp" 27 | 28 | #include "geometry.hpp" 29 | 30 | #include 31 | 32 | namespace Bempp 33 | { 34 | 35 | /** \brief Abstract geometry factory. */ 36 | class GeometryFactory 37 | { 38 | public: 39 | typedef Bempp::Geometry Geometry; 40 | 41 | virtual ~GeometryFactory() {} 42 | 43 | virtual std::auto_ptr make() const = 0; 44 | }; 45 | 46 | } // namespace Bempp 47 | 48 | #endif // GEOMETRY_FACTORY_HPP 49 | -------------------------------------------------------------------------------- /lib/grid/geometry_type.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2012 by the BEM++ Authors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | #ifndef bempp_geometry_type_decl_hpp 21 | #define bempp_geometry_type_decl_hpp 22 | 23 | #include "../common/common.hpp" 24 | 25 | #include 26 | #include 27 | 28 | namespace Bempp 29 | { 30 | typedef Dune::GeometryType GeometryType; 31 | } 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /lib/grid/max_distance.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2012 by the BEM++ Authors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #ifndef bempp_concrete_element_mapper_hpp 22 | #define bempp_concrete_element_mapper_hpp 23 | 24 | #include "../common/common.hpp" 25 | 26 | namespace Bempp 27 | { 28 | 29 | class Grid; 30 | 31 | /** \brief Return an upper bound on the maximum distance between elements 32 | * belonging to two grids. 33 | * 34 | * \note The returned number is an *upper bound* rather than an exact value 35 | * (it is calculated from the bounding boxes of the two grids) */ 36 | double maxDistance(const Grid& grid1, const Grid& grid2); 37 | 38 | } // namespace Bempp 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /lib/grid/ray_triangle_intersection.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2012 by the BEM++ Authors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #ifndef bempp_ray_triangle_intersection_hpp 22 | #define bempp_ray_triangle_intersection_hpp 23 | 24 | #include "../common/common.hpp" 25 | 26 | namespace Bempp 27 | { 28 | 29 | double zRayIntersectsTriangle( 30 | const double *p, const double *v0, const double *v1, const double *v2, 31 | double* intersection); 32 | 33 | } // namespace Bempp 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /lib/linalg/belos_solver_convergence_tolerance.patch: -------------------------------------------------------------------------------- 1 | --- /home/wojtek/tmp/trilinos-10.10.1-Source/packages/stratimikos/adapters/belos/src/Thyra_BelosLinearOpWithSolve_def.hpp 2012-02-22 23:02:42.000000000 +0000 2 | +++ Thyra_BelosLinearOpWithSolve_def.hpp 2012-04-24 18:16:58.000000000 +0100 3 | @@ -124,6 +124,8 @@ 4 | const int convergenceTestFrequency 5 | ) 6 | { 7 | + typedef typename Teuchos::ScalarTraits::magnitudeType MagnitudeType; 8 | + 9 | this->setLinePrefix("BELOS/T"); 10 | // ToDo: Validate input 11 | lp_ = lp; 12 | @@ -139,13 +141,13 @@ 13 | // not, use the default from the solver. 14 | if ( !is_null(solverPL_) ) { 15 | if (solverPL_->isParameter("Convergence Tolerance")) { 16 | - defaultTol_ = solverPL_->get("Convergence Tolerance"); 17 | + defaultTol_ = solverPL_->get("Convergence Tolerance"); 18 | } 19 | } 20 | else { 21 | RCP defaultPL = 22 | iterativeSolver->getValidParameters(); 23 | - defaultTol_ = defaultPL->get("Convergence Tolerance"); 24 | + defaultTol_ = defaultPL->get("Convergence Tolerance"); 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /lib/linalg/belos_solver_wrapper_fwd.hpp: -------------------------------------------------------------------------------- 1 | #ifndef bempp_belos_solver_wrapper_fwd_hpp 2 | #define bempp_belos_solver_wrapper_fwd_hpp 3 | 4 | #include "../common/common.hpp" 5 | 6 | #include "bempp/common/config_trilinos.hpp" 7 | 8 | #ifdef WITH_TRILINOS 9 | #include 10 | 11 | namespace Bempp 12 | { 13 | 14 | /** \cond FORWARD_DECL */ 15 | template class BelosSolverWrapper; 16 | /** \endcond */ 17 | 18 | Teuchos::RCP defaultGmresParameterList( 19 | double tol, int maxIterationCount = 1000); 20 | Teuchos::RCP defaultCgParameterList( 21 | double tol, int maxIterationCount = 1000); 22 | Teuchos::RCP defaultGmresParameterList( 23 | float tol, int maxIterationCount = 1000); 24 | Teuchos::RCP defaultCgParameterList( 25 | float tol, int maxIterationCount = 1000); 26 | 27 | } // namespace Bempp 28 | 29 | #endif // WITH_TRILINOS 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /python/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(doc) 2 | add_subdirectory(bempp) 3 | add_subdirectory(examples) 4 | 5 | if (WITH_TESTS) 6 | add_subdirectory(tests) 7 | endif (WITH_TESTS) 8 | -------------------------------------------------------------------------------- /python/bempp/__init__.py: -------------------------------------------------------------------------------- 1 | from core import * -------------------------------------------------------------------------------- /python/bempp/armadillo.i: -------------------------------------------------------------------------------- 1 | // Generate a minimal wrapper for arma::Mat 2 | // (used by the wrapper of Bempp::VtkWriter, not intended to be accessed by the user) 3 | namespace arma { 4 | template 5 | class Mat { 6 | public: 7 | ~Mat(); 8 | }; 9 | 10 | %template(__Mat_double) Mat; 11 | } 12 | 13 | // Define typemaps 14 | %include "armadillo2numpy.i" 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /python/bempp/assembly/abstract_boundary_operator.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "assembly/abstract_boundary_operator.hpp" 3 | #include 4 | %} 5 | 6 | // TODO 7 | // %include "abstract_boundary_operator_docstrings.i" 8 | 9 | BEMPP_DECLARE_SHARED_PTR_CLASS_TEMPLATED_ON_BASIS_AND_RESULT( 10 | Bempp::AbstractBoundaryOperator); 11 | 12 | namespace Bempp 13 | { 14 | 15 | BEMPP_FORWARD_DECLARE_CLASS_TEMPLATED_ON_BASIS_AND_RESULT(AbstractBoundaryOperator); 16 | 17 | template class GridFunction; 18 | template class Space; 19 | class AssemblyOptions; 20 | class Symmetry; 21 | 22 | %extend AbstractBoundaryOperator 23 | { 24 | %ignore id; 25 | } 26 | 27 | BEMPP_EXTEND_CLASS_TEMPLATED_ON_BASIS_AND_RESULT(AbstractBoundaryOperator); 28 | 29 | } // namespace Bempp 30 | 31 | #define shared_ptr boost::shared_ptr 32 | %include "assembly/abstract_boundary_operator.hpp" 33 | #undef shared_ptr 34 | 35 | namespace Bempp 36 | { 37 | BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_BASIS_AND_RESULT(AbstractBoundaryOperator); 38 | } 39 | -------------------------------------------------------------------------------- /python/bempp/assembly/abstract_boundary_operator_sum.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "assembly/abstract_boundary_operator_sum.hpp" 3 | %} 4 | 5 | // TODO 6 | // %include "boundary_operator_sum_docstrings.i" 7 | 8 | %include "assembly/abstract_boundary_operator_sum.hpp" 9 | 10 | namespace Bempp 11 | { 12 | BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_BASIS_AND_RESULT(AbstractBoundaryOperatorSum); 13 | } 14 | -------------------------------------------------------------------------------- /python/bempp/assembly/aca_approximate_lu_inverse.i: -------------------------------------------------------------------------------- 1 | #ifdef WITH_AHMED 2 | 3 | %{ 4 | #include "assembly/aca_approximate_lu_inverse.hpp" 5 | #include "assembly/discrete_aca_boundary_operator.hpp" 6 | #include "fiber/scalar_traits.hpp" 7 | #include "common/shared_ptr.hpp" 8 | %} 9 | 10 | %define NUMERICAL_ACA_LU_APPROXIMATE_INVERSE(VALUE,PY_VALUE) 11 | %inline %{ 12 | namespace Bempp{ 13 | boost::shared_ptr > createAcaApproximateLuInverse_## PY_VALUE ( 14 | const boost::shared_ptr >& op, 15 | Fiber::ScalarTraits< VALUE >::RealType delta){ 16 | 17 | const DiscreteAcaBoundaryOperator< VALUE >& acaOp = 18 | DiscreteAcaBoundaryOperator< VALUE >::castToAca(*op); 19 | boost::shared_ptr > acaLu(new AcaApproximateLuInverse< VALUE >(acaOp,delta)); 20 | return acaLu; 21 | 22 | } 23 | } 24 | %} 25 | %enddef 26 | BEMPP_ITERATE_OVER_BASIS_TYPES(NUMERICAL_ACA_LU_APPROXIMATE_INVERSE) 27 | 28 | #endif // WITH_AHMED 29 | -------------------------------------------------------------------------------- /python/bempp/assembly/assembled_potential_operator.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "assembly/assembled_potential_operator.hpp" 3 | %} 4 | 5 | namespace Bempp 6 | { 7 | 8 | BEMPP_FORWARD_DECLARE_CLASS_TEMPLATED_ON_BASIS_AND_RESULT(AssembledPotentialOperator); 9 | 10 | %extend AssembledPotentialOperator 11 | { 12 | %apply arma::Mat& ARGOUT_MAT { arma::Mat& result_ }; 13 | %apply arma::Mat& ARGOUT_MAT { arma::Mat& result_ }; 14 | %apply arma::Mat >& ARGOUT_MAT 15 | { arma::Mat >& result_ }; 16 | %apply arma::Mat >& ARGOUT_MAT 17 | { arma::Mat >& result_ }; 18 | 19 | void _apply( 20 | arma::Mat& result_, 21 | const GridFunction& argument) 22 | { 23 | result_ = $self->apply(argument); 24 | } 25 | 26 | %ignore apply; 27 | 28 | %pythoncode { 29 | def apply(self, argument): 30 | return self._apply(argument) 31 | } 32 | } 33 | 34 | BEMPP_EXTEND_CLASS_TEMPLATED_ON_BASIS_AND_RESULT(AssembledPotentialOperator); 35 | 36 | } // namespace Bempp 37 | 38 | #define shared_ptr boost::shared_ptr 39 | %include "assembly/assembled_potential_operator.hpp" 40 | #undef 41 | 42 | namespace Bempp 43 | { 44 | BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_BASIS_AND_RESULT(AssembledPotentialOperator); 45 | } 46 | 47 | %clear arma::Mat& result_; 48 | %clear arma::Mat& result_; 49 | %clear arma::Mat >& result_; 50 | %clear arma::Mat >& result_; 51 | -------------------------------------------------------------------------------- /python/bempp/assembly/assembly_options.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "assembly/assembly_options.hpp" 3 | %} 4 | 5 | namespace Bempp 6 | { 7 | 8 | %feature("autodoc", "eps -> float") AcaOptions::eps; 9 | %feature("autodoc", "eta -> float") AcaOptions::eta; 10 | %feature("autodoc", "globalAssemblyBeforeCompression -> bool") AcaOptions::globalAssemblyBeforeCompression; 11 | %feature("autodoc", "maximumBlockSize -> int") AcaOptions::maximumBlockSize; 12 | %feature("autodoc", "maximumRank -> int") AcaOptions::maximumRank; 13 | %feature("autodoc", "minimumBlockSize -> int") AcaOptions::minimumBlockSize; 14 | %feature("autodoc", "outputFname -> string") AcaOptions::outputFname; 15 | %feature("autodoc", "outputPostscript -> bool") AcaOptions::outputPostscript; 16 | %feature("autodoc", "recompress -> bool") AcaOptions::recompress; 17 | %feature("autodoc", "scaling -> float") AcaOptions::scaling; 18 | 19 | %extend AssemblyOptions 20 | { 21 | %ignore switchToTbb; 22 | %feature("compactdefaultargs") enableSingularIntegralCaching; 23 | %feature("compactdefaultargs") enableSparseStorageOfMassMatrices; 24 | } 25 | 26 | } // namespace Bempp 27 | 28 | %include "assembly/aca_options.hpp" 29 | %include "assembly/assembly_options.hpp" 30 | -------------------------------------------------------------------------------- /python/bempp/assembly/blocked_boundary_operator.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "assembly/blocked_boundary_operator.hpp" 3 | %} 4 | 5 | namespace Bempp 6 | { 7 | BEMPP_FORWARD_DECLARE_CLASS_TEMPLATED_ON_BASIS_AND_RESULT(BlockedBoundaryOperator); 8 | 9 | %extend BlockedBoundaryOperator { 10 | %ignore apply; 11 | } 12 | 13 | BEMPP_EXTEND_CLASS_TEMPLATED_ON_BASIS_AND_RESULT(BlockedBoundaryOperator); 14 | } 15 | 16 | #define shared_ptr boost::shared_ptr 17 | %include "assembly/blocked_boundary_operator.hpp" 18 | #undef shared_ptr 19 | 20 | namespace Bempp 21 | { 22 | BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_BASIS_AND_RESULT(BlockedBoundaryOperator); 23 | } 24 | -------------------------------------------------------------------------------- /python/bempp/assembly/blocked_operator_structure.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "assembly/blocked_operator_structure.hpp" 3 | %} 4 | 5 | namespace Bempp 6 | { 7 | BEMPP_FORWARD_DECLARE_CLASS_TEMPLATED_ON_BASIS_AND_RESULT(BlockedOperatorStructure); 8 | BEMPP_EXTEND_CLASS_TEMPLATED_ON_BASIS_AND_RESULT(BlockedOperatorStructure); 9 | } 10 | 11 | %include "assembly/blocked_operator_structure.hpp" 12 | 13 | namespace Bempp 14 | { 15 | BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_BASIS_AND_RESULT(BlockedOperatorStructure); 16 | } 17 | 18 | -------------------------------------------------------------------------------- /python/bempp/assembly/context.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "assembly/context.hpp" 3 | %} 4 | 5 | // TODO 6 | // %include "context_docstrings.i" 7 | 8 | %shared_ptr(Bempp::Context); 9 | %shared_ptr(Bempp::Context >); 10 | %shared_ptr(Bempp::Context, std::complex >); 11 | %shared_ptr(Bempp::Context); 12 | %shared_ptr(Bempp::Context >); 13 | %shared_ptr(Bempp::Context, std::complex >); 14 | 15 | namespace Bempp 16 | { 17 | 18 | BEMPP_FORWARD_DECLARE_CLASS_TEMPLATED_ON_BASIS_AND_RESULT(Context); 19 | 20 | class AssemblyOptions; 21 | 22 | BEMPP_EXTEND_CLASS_TEMPLATED_ON_BASIS_AND_RESULT(Context); 23 | 24 | } // namespace Bempp 25 | 26 | #define shared_ptr boost::shared_ptr 27 | %include "assembly/context.hpp" 28 | #undef shared_ptr 29 | 30 | namespace Bempp 31 | { 32 | BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_BASIS_AND_RESULT(Context); 33 | } 34 | -------------------------------------------------------------------------------- /python/bempp/assembly/discrete_aca_boundary_operator.i: -------------------------------------------------------------------------------- 1 | #ifdef WITH_AHMED 2 | 3 | %{ 4 | #include "assembly/discrete_aca_boundary_operator.hpp" 5 | #include "fiber/scalar_traits.hpp" 6 | #include "common/shared_ptr.hpp" 7 | %} 8 | 9 | namespace Bempp 10 | { 11 | %ignore DiscreteAcaBoundaryOperator; 12 | } 13 | 14 | #define shared_ptr boost::shared_ptr 15 | %include "assembly/discrete_aca_boundary_operator.hpp" 16 | #undef boost::shared_ptr 17 | 18 | %define BEMPP_ACA_FREE_FUNCTIONS(VALUE,PY_VALUE) 19 | namespace Bempp 20 | { 21 | %template(acaOperatorApproximateLuInverse_## PY_VALUE) 22 | acaOperatorApproximateLuInverse< VALUE >; 23 | %template(scaledAcaOperator_## PY_VALUE) 24 | scaledAcaOperator< VALUE >; 25 | %template(acaOperatorSum_## PY_VALUE) 26 | acaOperatorSum< VALUE >; 27 | } 28 | %enddef 29 | 30 | BEMPP_ITERATE_OVER_BASIS_TYPES(BEMPP_ACA_FREE_FUNCTIONS) 31 | 32 | #endif // WITH_AHMED 33 | -------------------------------------------------------------------------------- /python/bempp/assembly/discrete_dense_boundary_operator.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "assembly/discrete_dense_boundary_operator.hpp" 3 | #include "fiber/scalar_traits.hpp" 4 | #include "common/shared_ptr.hpp" 5 | %} 6 | 7 | namespace Bempp 8 | { 9 | %ignore DiscreteDenseBoundaryOperator; 10 | 11 | %apply const arma::Mat& IN_MAT { 12 | const arma::Mat& mat 13 | }; 14 | %apply const arma::Mat& IN_MAT { 15 | const arma::Mat& mat 16 | }; 17 | %apply const arma::Mat >& IN_MAT { 18 | const arma::Mat >& mat 19 | }; 20 | %apply const arma::Mat >& IN_MAT { 21 | const arma::Mat >& mat 22 | }; 23 | } 24 | 25 | #define shared_ptr boost::shared_ptr 26 | //%include "assembly/discrete_dense_boundary_operator.hpp" 27 | namespace Bempp 28 | { 29 | template 30 | shared_ptr > discreteDenseBoundaryOperator( 31 | const arma::Mat& mat); 32 | } 33 | #undef boost::shared_ptr 34 | 35 | namespace Bempp 36 | { 37 | 38 | BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_VALUE( 39 | discreteDenseBoundaryOperator); 40 | 41 | %clear const arma::Mat& mat; 42 | %clear const arma::Mat& mat; 43 | %clear const arma::Mat >& mat; 44 | %clear const arma::Mat >& mat; 45 | 46 | } 47 | -------------------------------------------------------------------------------- /python/bempp/assembly/discrete_inverse_sparse_boundary_operator.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "assembly/discrete_inverse_sparse_boundary_operator.hpp" 3 | %} 4 | 5 | namespace Bempp { 6 | 7 | #define shared_ptr boost::shared_ptr 8 | template 9 | shared_ptr > 10 | discreteSparseInverse(const shared_ptr >& discreteOp); 11 | #undef shared_ptr 12 | 13 | BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_VALUE(discreteSparseInverse) 14 | 15 | } 16 | -------------------------------------------------------------------------------- /python/bempp/assembly/evaluation_options.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "assembly/evaluation_options.hpp" 3 | %} 4 | 5 | namespace Bempp 6 | { 7 | 8 | %extend EvaluationOptions 9 | { 10 | %ignore switchToTbb; 11 | } 12 | 13 | } // namespace Bempp 14 | 15 | %include "assembly/evaluation_options.hpp" 16 | 17 | 18 | -------------------------------------------------------------------------------- /python/bempp/assembly/identity_operator.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "assembly/identity_operator.hpp" 3 | %} 4 | 5 | namespace Bempp 6 | { 7 | %feature("compactdefaultargs") identityOperator; 8 | 9 | // Do not emit warnings about ignored assignment operators. 10 | %warnfilter(362) IdentityOperator::operator=; 11 | } 12 | 13 | #define shared_ptr boost::shared_ptr 14 | %include "assembly/identity_operator.hpp" 15 | #undef shared_ptr 16 | 17 | namespace Bempp 18 | { 19 | BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_BASIS_AND_RESULT(identityOperator); 20 | } 21 | -------------------------------------------------------------------------------- /python/bempp/assembly/laplace_3d_operators.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "assembly/laplace_3d_boundary_operator_base.hpp" 3 | #include "assembly/laplace_3d_single_layer_boundary_operator.hpp" 4 | #include "assembly/laplace_3d_double_layer_boundary_operator.hpp" 5 | #include "assembly/laplace_3d_adjoint_double_layer_boundary_operator.hpp" 6 | #include "assembly/laplace_3d_hypersingular_boundary_operator.hpp" 7 | %} 8 | 9 | namespace Bempp 10 | { 11 | %feature("compactdefaultargs") 12 | laplace3dSingleLayerBoundaryOperator; 13 | %feature("compactdefaultargs") 14 | laplace3dDoubleLayerBoundaryOperator; 15 | %feature("compactdefaultargs") 16 | laplace3dAdjointDoubleLayerBoundaryOperator; 17 | %feature("compactdefaultargs") 18 | laplace3dHypersingularBoundaryOperator; 19 | 20 | // Do not emit warnings about ignored assignment operators. 21 | %warnfilter(362) Laplace3dBoundaryOperatorBase::operator=; 22 | 23 | } // namespace Bempp 24 | 25 | #define shared_ptr boost::shared_ptr 26 | %include "assembly/laplace_3d_boundary_operator_base.hpp" 27 | %include "assembly/laplace_3d_single_layer_boundary_operator.hpp" 28 | %include "assembly/laplace_3d_double_layer_boundary_operator.hpp" 29 | %include "assembly/laplace_3d_adjoint_double_layer_boundary_operator.hpp" 30 | %include "assembly/laplace_3d_hypersingular_boundary_operator.hpp" 31 | #undef shared_ptr 32 | 33 | namespace Bempp 34 | { 35 | 36 | BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_BASIS_AND_RESULT( 37 | laplace3dSingleLayerBoundaryOperator); 38 | BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_BASIS_AND_RESULT( 39 | laplace3dDoubleLayerBoundaryOperator); 40 | BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_BASIS_AND_RESULT( 41 | laplace3dAdjointDoubleLayerBoundaryOperator); 42 | BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_BASIS_AND_RESULT( 43 | laplace3dHypersingularBoundaryOperator); 44 | 45 | } // namespace Bempp 46 | 47 | -------------------------------------------------------------------------------- /python/bempp/assembly/laplace_3d_potential_operators.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "assembly/laplace_3d_single_layer_potential_operator.hpp" 3 | #include "assembly/laplace_3d_double_layer_potential_operator.hpp" 4 | %} 5 | 6 | namespace Bempp 7 | { 8 | %feature("compactdefaultargs") 9 | laplace3dSingleLayerPotentialOperator; 10 | %feature("compactdefaultargs") 11 | laplace3dDoubleLayerPotentialOperator; 12 | } // namespace Bempp 13 | 14 | %inline %{ 15 | namespace Bempp 16 | { 17 | 18 | template 19 | boost::shared_ptr > 20 | laplace3dSingleLayerPotentialOperator() 21 | { 22 | typedef Bempp::Laplace3dSingleLayerPotentialOperator Type; 23 | return boost::shared_ptr(new Type); 24 | } 25 | 26 | template 27 | boost::shared_ptr > 28 | laplace3dDoubleLayerPotentialOperator() 29 | { 30 | typedef Bempp::Laplace3dDoubleLayerPotentialOperator Type; 31 | return boost::shared_ptr(new Type); 32 | } 33 | 34 | } // namespace Bempp 35 | %} 36 | 37 | namespace Bempp 38 | { 39 | BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_BASIS_AND_RESULT(laplace3dSingleLayerPotentialOperator); 40 | BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_BASIS_AND_RESULT(laplace3dDoubleLayerPotentialOperator); 41 | } 42 | -------------------------------------------------------------------------------- /python/bempp/assembly/laplace_beltrami_3d_operator.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "assembly/laplace_beltrami_3d_operator.hpp" 3 | %} 4 | 5 | namespace Bempp 6 | { 7 | %feature("compactdefaultargs") laplaceBeltrami3dOperator; 8 | 9 | // Do not emit warnings about ignored assignment operators. 10 | %warnfilter(362) LaplaceBeltrami3dOperator::operator=; 11 | } 12 | 13 | #define shared_ptr boost::shared_ptr 14 | %include "assembly/laplace_beltrami_3d_operator.hpp" 15 | #undef shared_ptr 16 | 17 | namespace Bempp 18 | { 19 | BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_BASIS_AND_RESULT(laplaceBeltrami3dOperator); 20 | } 21 | -------------------------------------------------------------------------------- /python/bempp/assembly/modified_helmholtz_3d_operators.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "assembly/modified_helmholtz_3d_single_layer_boundary_operator.hpp" 3 | #include "assembly/modified_helmholtz_3d_double_layer_boundary_operator.hpp" 4 | #include "assembly/modified_helmholtz_3d_adjoint_double_layer_boundary_operator.hpp" 5 | #include "assembly/modified_helmholtz_3d_hypersingular_boundary_operator.hpp" 6 | %} 7 | 8 | namespace Bempp 9 | { 10 | %feature("compactdefaultargs") 11 | modifiedHelmholtz3dSingleLayerBoundaryOperator; 12 | %feature("compactdefaultargs") 13 | modifiedHelmholtz3dDoubleLayerBoundaryOperator; 14 | %feature("compactdefaultargs") 15 | modifiedHelmholtz3dAdjointDoubleLayerBoundaryOperator; 16 | %feature("compactdefaultargs") 17 | modifiedHelmholtz3dHypersingularBoundaryOperator; 18 | } // namespace Bempp 19 | 20 | #define shared_ptr boost::shared_ptr 21 | %include "assembly/modified_helmholtz_3d_single_layer_boundary_operator.hpp" 22 | %include "assembly/modified_helmholtz_3d_double_layer_boundary_operator.hpp" 23 | %include "assembly/modified_helmholtz_3d_adjoint_double_layer_boundary_operator.hpp" 24 | %include "assembly/modified_helmholtz_3d_hypersingular_boundary_operator.hpp" 25 | #undef shared_ptr 26 | 27 | namespace Bempp 28 | { 29 | 30 | BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_BASIS_KERNEL_AND_RESULT( 31 | modifiedHelmholtz3dSingleLayerBoundaryOperator); 32 | BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_BASIS_KERNEL_AND_RESULT( 33 | modifiedHelmholtz3dDoubleLayerBoundaryOperator); 34 | BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_BASIS_KERNEL_AND_RESULT( 35 | modifiedHelmholtz3dAdjointDoubleLayerBoundaryOperator); 36 | BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_BASIS_KERNEL_AND_RESULT( 37 | modifiedHelmholtz3dHypersingularBoundaryOperator); 38 | 39 | } // namespace Bempp 40 | -------------------------------------------------------------------------------- /python/bempp/assembly/null_operator.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "assembly/null_operator.hpp" 3 | %} 4 | 5 | namespace Bempp 6 | { 7 | %feature("compactdefaultargs") nullOperator; 8 | } 9 | 10 | #define shared_ptr boost::shared_ptr 11 | %include "assembly/null_operator.hpp" 12 | #undef shared_ptr 13 | 14 | namespace Bempp 15 | { 16 | BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_BASIS_AND_RESULT(nullOperator); 17 | } 18 | -------------------------------------------------------------------------------- /python/bempp/assembly/numerical_quadrature_strategy.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "assembly/numerical_quadrature_strategy.hpp" 3 | %} 4 | 5 | %define BEMPP_NUMERICAL_QUADRATURE_STRATEGY_FACTORY(BASIS,RESULT,PY_BASIS,PY_RESULT) 6 | %inline %{ 7 | 8 | namespace Bempp 9 | { 10 | 11 | boost::shared_ptr > 12 | numericalQuadratureStrategy_## PY_BASIS ## _ ## PY_RESULT( 13 | const Fiber::AccuracyOptionsEx& accuracyOptions) 14 | { 15 | return boost::shared_ptr >( 16 | new NumericalQuadratureStrategy< BASIS , RESULT >(accuracyOptions)); 17 | } 18 | 19 | boost::shared_ptr > 20 | numericalQuadratureStrategy_## PY_BASIS ## _ ## PY_RESULT( 21 | const Fiber::AccuracyOptions& accuracyOptions) 22 | { 23 | return boost::shared_ptr >( 24 | new NumericalQuadratureStrategy< BASIS , RESULT >(accuracyOptions)); 25 | } 26 | 27 | } // namespace Bempp 28 | 29 | %} 30 | %enddef 31 | 32 | BEMPP_ITERATE_OVER_BASIS_AND_RESULT_TYPES(BEMPP_NUMERICAL_QUADRATURE_STRATEGY_FACTORY) 33 | 34 | -------------------------------------------------------------------------------- /python/bempp/assembly/scaled_abstract_boundary_operator.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "assembly/scaled_abstract_boundary_operator.hpp" 3 | %} 4 | 5 | // TODO 6 | // %include "scaled_abstract_boundary_operator_docstrings.i" 7 | 8 | %include "assembly/scaled_abstract_boundary_operator.hpp" 9 | 10 | namespace Bempp 11 | { 12 | BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_BASIS_AND_RESULT(ScaledAbstractBoundaryOperator); 13 | } 14 | -------------------------------------------------------------------------------- /python/bempp/assembly/surface_normal_dependent_functor.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "assembly/surface_normal_dependent_functor.hpp" 3 | %} 4 | 5 | namespace Bempp 6 | { 7 | BEMPP_FORWARD_DECLARE_CLASS_TEMPLATED_ON_VALUE(SurfaceNormalDependentFunctor); 8 | BEMPP_EXTEND_CLASS_TEMPLATED_ON_VALUE(SurfaceNormalDependentFunctor); 9 | } // namespace Bempp 10 | 11 | %include "assembly/surface_normal_dependent_functor.hpp" 12 | 13 | namespace Bempp 14 | { 15 | BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_VALUE(SurfaceNormalDependentFunctor); 16 | } // namespace Bempp 17 | -------------------------------------------------------------------------------- /python/bempp/assembly/surface_normal_independent_functor.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "assembly/surface_normal_independent_functor.hpp" 3 | %} 4 | 5 | namespace Bempp 6 | { 7 | BEMPP_FORWARD_DECLARE_CLASS_TEMPLATED_ON_VALUE(SurfaceNormalIndependentFunctor); 8 | BEMPP_EXTEND_CLASS_TEMPLATED_ON_VALUE(SurfaceNormalIndependentFunctor); 9 | } // namespace Bempp 10 | 11 | %include "assembly/surface_normal_independent_functor.hpp" 12 | 13 | namespace Bempp 14 | { 15 | BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_VALUE(SurfaceNormalIndependentFunctor); 16 | } // namespace Bempp 17 | -------------------------------------------------------------------------------- /python/bempp/assembly/symmetry.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "assembly/symmetry.hpp" 3 | %} 4 | 5 | %include "assembly/symmetry.hpp" 6 | -------------------------------------------------------------------------------- /python/bempp/assembly/transposition_mode.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "assembly/transposition_mode.hpp" 3 | %} 4 | 5 | namespace Bempp 6 | { 7 | 8 | // Handle the enum TranspositionMode like a string 9 | %typemap(typecheck) TranspositionMode 10 | { 11 | $1 = PyString_Check($input); 12 | } 13 | %typemap(in) TranspositionMode 14 | { 15 | if (!PyString_Check($input)) 16 | { 17 | PyErr_SetString(PyExc_TypeError, 18 | "in method '$symname', argument $argnum: " 19 | "expected a string"); 20 | SWIG_fail; 21 | } 22 | const std::string s(PyString_AsString($input)); 23 | if (s == "no_transpose" || s == "n" || s == "") 24 | $1 = Bempp::NO_TRANSPOSE; 25 | else if (s == "transpose" || s == "t") 26 | $1 = Bempp::TRANSPOSE; 27 | else if (s == "conjugate" || s == "c") 28 | $1 = Bempp::CONJUGATE; 29 | else if (s == "conjugate_transpose" || s == "ct" || s == "h") 30 | $1 = Bempp::CONJUGATE_TRANSPOSE; 31 | else 32 | { 33 | PyErr_SetString(PyExc_ValueError, 34 | "in method '$symname', argument $argnum: " 35 | "expected one of '', 'n', 'no_transpose', " 36 | "'t', 'transpose', " 37 | "'c', 'conjugate', " 38 | "'h', 'ct' or 'conjugate_transpose'"); 39 | SWIG_fail; 40 | } 41 | } 42 | 43 | } // namespace Bempp 44 | 45 | %include "assembly/transposition_mode.hpp" 46 | -------------------------------------------------------------------------------- /python/bempp/auto_ptr.i: -------------------------------------------------------------------------------- 1 | %define AUTO_PTR_TYPEMAPS(TYPE...) 2 | %typemap (out) std::auto_ptr %{ 3 | %set_output(SWIG_NewPointerObj(%as_voidptr($1.release()), 4 | $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); 5 | %} 6 | %template() std::auto_ptr; 7 | %enddef 8 | 9 | %define AUTO_PTR_TYPEMAPS_FOR_CLASS_TEMPLATED_ON_RESULT(TYPE) 10 | AUTO_PTR_TYPEMAPS(TYPE); 11 | AUTO_PTR_TYPEMAPS(TYPE); 12 | AUTO_PTR_TYPEMAPS(TYPE >); 13 | AUTO_PTR_TYPEMAPS(TYPE >); 14 | %enddef 15 | 16 | %define AUTO_PTR_TYPEMAPS_FOR_CLASS_TEMPLATED_ON_BASIS_AND_RESULT(TYPE) 17 | AUTO_PTR_TYPEMAPS(TYPE); 18 | AUTO_PTR_TYPEMAPS(TYPE >); 19 | AUTO_PTR_TYPEMAPS(TYPE, std::complex >); 20 | AUTO_PTR_TYPEMAPS(TYPE); 21 | AUTO_PTR_TYPEMAPS(TYPE >); 22 | AUTO_PTR_TYPEMAPS(TYPE, std::complex >); 23 | %enddef 24 | 25 | namespace std { 26 | template class auto_ptr {}; 27 | } 28 | -------------------------------------------------------------------------------- /python/bempp/bempp.swg: -------------------------------------------------------------------------------- 1 | %module(package="bempp") core 2 | // %include "core.i" 3 | %include "exception.i" 4 | %import "core.i" 5 | -------------------------------------------------------------------------------- /python/bempp/bempp_shared_ptr.i: -------------------------------------------------------------------------------- 1 | %include 2 | /* #include */ 3 | %{ 4 | #include "common/shared_ptr.hpp" 5 | /* using Bempp::shared_ptr; */ 6 | %} 7 | 8 | /* %inline %{ */ 9 | /* #define shared_ptr boost::shared_ptr */ 10 | /* %} */ 11 | 12 | /* #define shared_ptr boost::shared_ptr */ 13 | -------------------------------------------------------------------------------- /python/bempp/config.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "bempp/common/config_ahmed.hpp" 3 | #include "bempp/common/config_alugrid.hpp" 4 | #include "bempp/common/config_data_types.hpp" 5 | #include "bempp/common/config_opencl.hpp" 6 | #include "bempp/common/config_trilinos.hpp" 7 | %} 8 | 9 | %include "bempp/common/config_ahmed.hpp" 10 | %include "bempp/common/config_alugrid.hpp" 11 | %include "bempp/common/config_data_types.hpp" 12 | %include "bempp/common/config_opencl.hpp" 13 | %include "bempp/common/config_trilinos.hpp" 14 | 15 | %inline %{ 16 | #ifdef WITH_AHMED 17 | const bool _withAhmed = true; 18 | #else 19 | const bool _withAhmed = false; 20 | #endif // WITH_AHMED 21 | %} 22 | -------------------------------------------------------------------------------- /python/bempp/fiber/accuracy_options.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "fiber/accuracy_options.hpp" 3 | %} 4 | 5 | namespace Fiber 6 | { 7 | 8 | %feature("autodoc", "doubleRegular -> QuadratureOptions") AccuracyOptions::doubleRegular; 9 | %feature("autodoc", "doubleSingular -> QuadratureOptions") AccuracyOptions::doubleSingular; 10 | %feature("autodoc", "singleRegular -> QuadratureOptions") AccuracyOptions::singleRegular; 11 | 12 | %extend AccuracyOptionsEx 13 | { 14 | %feature("compactdefaultargs") setDoubleRegular; 15 | %feature("compactdefaultargs") setDoubleSingular; 16 | %feature("compactdefaultargs") setSingleRegular; 17 | } 18 | 19 | } // namespace Fiber 20 | 21 | %include "fiber/accuracy_options.hpp" 22 | -------------------------------------------------------------------------------- /python/bempp/fiber/numerical_quadrature_strategy.i: -------------------------------------------------------------------------------- 1 | namespace Fiber 2 | { 3 | 4 | template 6 | class NumericalQuadratureStrategy : 7 | public QuadratureStrategy< 8 | BasisFunctionType, ResultType, GeometryFactory> 9 | { 10 | public: 11 | const AccuracyOptions& accuracyOptions(); 12 | virtual ~NumericalQuadratureStrategy(); 13 | }; 14 | 15 | } // namespace Fiber 16 | 17 | %shared_ptr(Fiber::NumericalQuadratureStrategy); 18 | %shared_ptr(Fiber::NumericalQuadratureStrategy, Bempp::GeometryFactory >); 19 | %shared_ptr(Fiber::NumericalQuadratureStrategy, std::complex, Bempp::GeometryFactory >); 20 | %shared_ptr(Fiber::NumericalQuadratureStrategy); 21 | %shared_ptr(Fiber::NumericalQuadratureStrategy, Bempp::GeometryFactory >); 22 | %shared_ptr(Fiber::NumericalQuadratureStrategy, std::complex, Bempp::GeometryFactory >); 23 | 24 | namespace Fiber 25 | { 26 | BEMPP_INSTANTIATE_ANONYMOUSLY_SYMBOL_TEMPLATED_ON_BASIS_RESULT_AND_GEOMETRY_FACTORY( 27 | NumericalQuadratureStrategy); 28 | } 29 | -------------------------------------------------------------------------------- /python/bempp/fiber/opencl_options.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "fiber/opencl_options.hpp" 3 | %} 4 | 5 | %include "fiber/opencl_options.hpp" 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /python/bempp/fiber/parallelization_options.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "fiber/parallelization_options.hpp" 3 | %} 4 | 5 | namespace Fiber 6 | { 7 | 8 | %extend ParallelizationOptions 9 | { 10 | %feature("compactdefaultargs") setMaxThreadCount; 11 | } 12 | 13 | } 14 | 15 | %include "fiber/parallelization_options.hpp" 16 | -------------------------------------------------------------------------------- /python/bempp/fiber/quadrature_options.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "fiber/quadrature_options.hpp" 3 | %} 4 | 5 | %extend Fiber::QuadratureOptions 6 | { 7 | %pythoncode %{ 8 | def _setOrderIncrement(self, value): 9 | print ("Warning: the orderIncrement property is deprecated and " 10 | "maintained only for backwards compatibility. Please use " 11 | "setRelativeQuadratureOrder(quadratureOrder) instead.") 12 | self.setRelativeQuadratureOrder(value) 13 | 14 | def _setOrder(self, value): 15 | print ("Warning: the order property is deprecated and " 16 | "maintained only for backwards compatibility. Please use " 17 | "setAbsoluteQuadratureOrder(quadratureOrder) instead.") 18 | self.setAbsoluteQuadratureOrder(value) 19 | 20 | def _orderOrOrderIncrement(self): 21 | return self.quadratureOrder(0) 22 | 23 | orderIncrement = property(_orderOrOrderIncrement, _setOrderIncrement, 24 | """Relative quadrature order. 25 | 26 | DEPRECATED. Please use setRelativeQuadratureOrder() instead. 27 | """) 28 | order = property(_orderOrOrderIncrement, _setOrder, 29 | """Relative quadrature order. 30 | 31 | DEPRECATED. Please use setAbsoluteQuadratureOrder() instead. 32 | """) 33 | %} 34 | } 35 | 36 | %include "fiber/quadrature_options.hpp" 37 | -------------------------------------------------------------------------------- /python/bempp/fiber/verbosity_level.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "fiber/verbosity_level.hpp" 3 | %} 4 | 5 | // Handle the enum Fiber::VerbosityLevel::Level like a string 6 | %typemap(typecheck) Fiber::VerbosityLevel::Level 7 | { 8 | $1 = PyString_Check($input); 9 | } 10 | %typemap(in) Fiber::VerbosityLevel::Level 11 | { 12 | if (!PyString_Check($input)) 13 | { 14 | PyErr_SetString(PyExc_TypeError, "in method '$symname', argument $argnum: expected a string"); 15 | SWIG_fail; 16 | } 17 | const std::string s(PyString_AsString($input)); 18 | if (s == "default") 19 | $1 = Fiber::VerbosityLevel::DEFAULT; 20 | else if (s == "low") 21 | $1 = Fiber::VerbosityLevel::LOW; 22 | else if (s == "high") 23 | $1 = Fiber::VerbosityLevel::HIGH; 24 | else 25 | { 26 | PyErr_SetString(PyExc_ValueError, 27 | "in method '$symname', argument $argnum: " 28 | "expected one of 'default', 'low' or 'high'"); 29 | SWIG_fail; 30 | } 31 | } 32 | 33 | %typemap(out) Fiber::VerbosityLevel::Level 34 | { 35 | if ($1 == Fiber::VerbosityLevel::DEFAULT) 36 | $result = PyString_FromString("default"); 37 | else if ($1 == Fiber::VerbosityLevel::LOW) 38 | $result = PyString_FromString("low"); 39 | else if ($1 == Fiber::VerbosityLevel::HIGH) 40 | $result = PyString_FromString("high"); 41 | else 42 | { 43 | PyErr_SetString(PyExc_ValueError, "in method '$symname', unknown verbosity level."); 44 | SWIG_fail; 45 | } 46 | } 47 | 48 | %include "fiber/verbosity_level.hpp" 49 | 50 | %apply Fiber::VerbosityLevel::Level { Bempp::VerbosityLevel::Level }; 51 | -------------------------------------------------------------------------------- /python/bempp/grid/entity.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "grid/entity.hpp" 3 | %} 4 | 5 | namespace Bempp 6 | { 7 | template class Entity; 8 | } 9 | -------------------------------------------------------------------------------- /python/bempp/grid/geometry_factory.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "grid/geometry_factory.hpp" 3 | %} 4 | 5 | namespace Bempp 6 | { 7 | class Geometry; 8 | class GeometryFactory; 9 | } 10 | 11 | // %include "grid/geometry_factory.hpp" 12 | 13 | -------------------------------------------------------------------------------- /python/bempp/grid/grid.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "grid/grid.hpp" 3 | #include "grid/grid_view.hpp" 4 | #include "grid/entity_iterator.hpp" 5 | #include "grid/grid_parameters.hpp" 6 | %} 7 | 8 | %include "grid_docstrings.i" 9 | 10 | %shared_ptr(Bempp::Grid); 11 | 12 | %include "std_vector.i" 13 | namespace std 14 | { 15 | %template(vector_bool) vector; 16 | } 17 | 18 | namespace Bempp 19 | { 20 | 21 | %extend Grid 22 | { 23 | %pythonappend leafView %{ 24 | val._parentGrid = self 25 | %} 26 | 27 | %pythonappend levelView %{ 28 | val._parentGrid = self 29 | %} 30 | 31 | %pythonappend globalIdSet %{ 32 | val._parentGrid = self 33 | %} 34 | 35 | %pythoncode %{ 36 | def plot(self): 37 | "Visualize the Grid." 38 | 39 | from visualization import plotGrid 40 | plotGrid(self) 41 | %} 42 | 43 | 44 | // this function is only for internal use 45 | %ignore elementGeometryFactory; 46 | } 47 | 48 | %apply const arma::Mat& IN_MAT { 49 | const arma::Mat& points 50 | }; 51 | %apply const arma::Mat& IN_MAT { 52 | const arma::Mat& points 53 | }; 54 | 55 | %ignore areInside(const Grid& grid, const arma::Mat& points); 56 | 57 | } // namespace Bempp 58 | 59 | %include "grid/grid.hpp" 60 | 61 | %clear arma::Mat& points; 62 | %clear arma::Mat& points; 63 | -------------------------------------------------------------------------------- /python/bempp/grid/grid_parameters.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "grid/grid_parameters.hpp" 3 | %} 4 | 5 | namespace Bempp 6 | { 7 | 8 | %typemap(out) (GridParameters::Topology) 9 | { 10 | Bempp::GridParameters::Topology topology = $1; 11 | if (topology == Bempp::GridParameters::LINEAR) 12 | $result = PyString_FromString("linear"); 13 | else if (topology == Bempp::GridParameters::TRIANGULAR) 14 | $result = PyString_FromString("triangular"); 15 | else if (topology == Bempp::GridParameters::QUADRILATERAL) 16 | $result = PyString_FromString("quadrilateral"); 17 | else { 18 | PyErr_SetString(PyExc_TypeError, "in method $symname', topology type not supported"); 19 | SWIG_fail; 20 | } 21 | } 22 | 23 | %extend GridParameters 24 | { 25 | %feature("autodoc", "topology -> string") topology; 26 | } 27 | 28 | } // namespace Bempp 29 | 30 | %include "grid/grid_parameters.hpp" 31 | -------------------------------------------------------------------------------- /python/bempp/grid/id_set.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "grid/id_set.hpp" 3 | %} 4 | 5 | %include "id_set_docstrings.i" 6 | 7 | namespace Bempp 8 | { 9 | 10 | %extend IdSet { 11 | 12 | IdSet::IdType entityId(const EntityPointer<0>& ep) const { 13 | return $self->entityId(ep.entity()); 14 | } 15 | 16 | IdSet::IdType entityId(const EntityPointer<1>& ep) const { 17 | return $self->entityId(ep.entity()); 18 | } 19 | 20 | IdSet::IdType entityId(const EntityPointer<2>& ep) const { 21 | return $self->entityId(ep.entity()); 22 | } 23 | 24 | IdSet::IdType entityId(const EntityPointer<3>& ep) const { 25 | return $self->entityId(ep.entity()); 26 | } 27 | 28 | IdSet::IdType subEntityId(const EntityPointer<0>& ep, int i, unsigned int codimSub) const { 29 | return $self->subEntityId(ep.entity(), i, codimSub); 30 | } 31 | 32 | %ignore entityId; 33 | %ignore subEntityId; 34 | 35 | // Reference to the parent grid, stored to prevent it from 36 | // being garbage-collected while this view is alive 37 | %pythoncode %{ 38 | def parentGrid(self): return self._parentGrid 39 | parentGrid = property(parentGrid, None, None, "Parent grid") 40 | %} 41 | 42 | } 43 | 44 | } // namespace Bempp 45 | 46 | %include "grid/id_set.hpp" 47 | -------------------------------------------------------------------------------- /python/bempp/grid/id_set_docstrings.i: -------------------------------------------------------------------------------- 1 | // Docstrings ------------------------------------------------------------------ 2 | 3 | %define IdSet_docstring 4 | "Id set." 5 | %enddef 6 | 7 | %define IdSet_entityId_autodoc_docstring 8 | "entityId(self, e) -> int" 9 | %enddef 10 | 11 | %define IdSet_entityId_docstring 12 | "Id of the entity e." 13 | %enddef 14 | 15 | %define IdSet_subEntityId_autodoc_docstring 16 | "subEntityId(self, e, i, codimSub) -> int" 17 | %enddef 18 | 19 | %define IdSet_subEntityId_docstring 20 | "Id of i'th subentity of codimension codimSub of entity e of codimension 0." 21 | %enddef 22 | 23 | 24 | // Declarations ---------------------------------------------------------------- 25 | 26 | namespace Bempp 27 | { 28 | 29 | DECLARE_CLASS_DOCSTRING (IdSet); 30 | DECLARE_METHOD_DOCSTRING(IdSet, entityId, 0); 31 | DECLARE_METHOD_DOCSTRING(IdSet, subEntityId, 0); 32 | 33 | } // namespace Bempp 34 | -------------------------------------------------------------------------------- /python/bempp/grid/index_set.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "grid/index_set.hpp" 3 | %} 4 | 5 | %include "index_set_docstrings.i" 6 | 7 | namespace Bempp 8 | { 9 | 10 | %extend IndexSet { 11 | IndexSet::IndexType entityIndex(const EntityPointer<0>& ep) const { 12 | return $self->entityIndex(ep.entity()); 13 | } 14 | 15 | IndexSet::IndexType entityIndex(const EntityPointer<1>& ep) const { 16 | return $self->entityIndex(ep.entity()); 17 | } 18 | 19 | IndexSet::IndexType entityIndex(const EntityPointer<2>& ep) const { 20 | return $self->entityIndex(ep.entity()); 21 | } 22 | 23 | IndexSet::IndexType entityIndex(const EntityPointer<3>& ep) const { 24 | return $self->entityIndex(ep.entity()); 25 | } 26 | 27 | IndexSet::IndexType subEntityIndex(const EntityPointer<0>& ep, int i, unsigned int codimSub) const { 28 | return $self->subEntityIndex(ep.entity(), i, codimSub); 29 | } 30 | 31 | %ignore entityIndex; 32 | %ignore subEntityIndex; 33 | 34 | // Reference to the parent grid view, stored to prevent it from 35 | // being garbage-collected while this index set is alive 36 | %pythoncode %{ 37 | def parentGridView(self): return self._parentGridView 38 | parentGridView = property(parentGridView, None, None, "Parent grid view") 39 | %} 40 | } 41 | 42 | } // namespace Bempp 43 | 44 | %include "grid/index_set.hpp" 45 | -------------------------------------------------------------------------------- /python/bempp/grid/index_set_docstrings.i: -------------------------------------------------------------------------------- 1 | // Docstrings ------------------------------------------------------------------ 2 | 3 | %define IndexSet_docstring 4 | "Index set." 5 | %enddef 6 | 7 | %define IndexSet_entityIndex_autodoc_docstring 8 | "entityIndex(self, e) -> int" 9 | %enddef 10 | 11 | %define IndexSet_entityIndex_docstring 12 | "Index of the entity e. 13 | 14 | The result of calling this method with an entity that is not in the 15 | index set is undefined. 16 | 17 | Returns an integer in the range 0 ... (max number of entities in set - 1)." 18 | %enddef 19 | 20 | %define IndexSet_subEntityIndex_autodoc_docstring 21 | "subEntityIndex(self, e, i, codimSub) -> int" 22 | %enddef 23 | 24 | %define IndexSet_subEntityIndex_docstring 25 | "Index of i'th subentity of codimension codimSub of entity e of codimension 0." 26 | %enddef 27 | 28 | 29 | // Declarations ---------------------------------------------------------------- 30 | 31 | namespace Bempp 32 | { 33 | 34 | DECLARE_CLASS_DOCSTRING (IndexSet); 35 | DECLARE_METHOD_DOCSTRING(IndexSet, entityIndex, 0); 36 | DECLARE_METHOD_DOCSTRING(IndexSet, subEntityIndex, 0); 37 | 38 | } // namespace Bempp 39 | -------------------------------------------------------------------------------- /python/bempp/linalg/blocked_solution.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "linalg/blocked_solution.hpp" 3 | %} 4 | 5 | // TODO 6 | // %include "blocked_solution_docstrings.i" 7 | 8 | #ifdef WITH_TRILINOS 9 | 10 | namespace Bempp 11 | { 12 | 13 | BEMPP_FORWARD_DECLARE_CLASS_TEMPLATED_ON_BASIS_AND_RESULT(BlockedSolution); 14 | 15 | %extend BlockedSolution 16 | { 17 | %pythonappend gridFunction %{ 18 | val._parentSolution = self 19 | %} 20 | } 21 | 22 | } // namespace Bempp 23 | 24 | #define shared_ptr boost::shared_ptr 25 | %include "linalg/blocked_solution.hpp" 26 | #undef shared_ptr 27 | 28 | namespace Bempp 29 | { 30 | BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_BASIS_AND_RESULT(BlockedSolution); 31 | } // namespace Bempp 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /python/bempp/linalg/default_iterative_solver.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "linalg/default_iterative_solver.hpp" 3 | #include "linalg/blocked_solution.hpp" // temp 4 | #include "linalg/belos_solver_wrapper.hpp" 5 | %} 6 | 7 | // TODO 8 | // %include "default_iterative_solver_docstrings.i" 9 | 10 | #ifdef WITH_TRILINOS 11 | 12 | namespace Bempp 13 | { 14 | 15 | BEMPP_FORWARD_DECLARE_CLASS_TEMPLATED_ON_BASIS_AND_RESULT(DefaultIterativeSolver); 16 | 17 | %define BEMPP_EXTEND_DEFAULT_ITERATIVE_SOLVER(BASIS, RESULT, PYBASIS, PYRESULT) 18 | %extend DefaultIterativeSolver< BASIS, RESULT > 19 | { 20 | %pythonprepend setPreconditioner %{ 21 | print ("DefaultIterativeSolver.setPreconditioner() is deprecated. " 22 | "Pass the preconditioner directly to the initializeSolver() " 23 | "method.") 24 | %} 25 | } 26 | %enddef 27 | BEMPP_ITERATE_OVER_BASIS_AND_RESULT_TYPES(BEMPP_EXTEND_DEFAULT_ITERATIVE_SOLVER); 28 | 29 | Teuchos::RCP defaultGmresParameterList( 30 | double tol, int maxIterationCount = 1000); 31 | Teuchos::RCP defaultCgParameterList( 32 | double tol, int maxIterationCount = 1000); 33 | 34 | } // namespace Bempp 35 | 36 | #define shared_ptr boost::shared_ptr 37 | %include "linalg/default_iterative_solver.hpp" 38 | #undef shared_ptr 39 | 40 | namespace Bempp 41 | { 42 | BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_BASIS_AND_RESULT(DefaultIterativeSolver); 43 | } // namespace Bempp 44 | 45 | #endif // WITH_TRILINOS 46 | -------------------------------------------------------------------------------- /python/bempp/linalg/parameter_list.i: -------------------------------------------------------------------------------- 1 | #ifdef WITH_TRILINOS 2 | 3 | %{ 4 | #include 5 | #include 6 | #include 7 | %} 8 | 9 | // Temporary solution: convert parameter lists to XML strings. 10 | // In future we may want to convert them to Python dictionaries. 11 | 12 | %typemap(typecheck) const Teuchos::RCP& 13 | { 14 | $1 = PyString_Check($input); 15 | } 16 | %typemap(in) const Teuchos::RCP& 17 | { 18 | if (!PyString_Check($input)) 19 | { 20 | PyErr_SetString(PyExc_TypeError, "in method '$symname', argument " 21 | "$argnum: expected a string"); 22 | SWIG_fail; 23 | } 24 | const std::string s(PyString_AsString($input)); 25 | $1 = new Teuchos::RCP(Teuchos::getParametersFromXmlString(s)); 26 | } 27 | %typemap(freearg) const Teuchos::RCP& 28 | { 29 | delete $1; 30 | } 31 | 32 | %typemap(out) Teuchos::RCP 33 | { 34 | std::ostringstream out; 35 | Teuchos::writeParameterListToXmlOStream(*$1, out); 36 | $result = PyString_FromString(out.str().c_str()); 37 | } 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /python/bempp/linalg/preconditioner.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "linalg/preconditioner.hpp" 3 | %} 4 | 5 | 6 | 7 | namespace std { 8 | 9 | %template(vector_DiscreteOperator_float32) vector > >; 10 | %template(vector_DiscreteOperator_float64) vector > >; 11 | %template(vector_DiscreteOperatorVector_complex64) vector > > >; 12 | %template(vector_DiscreteOperatorVector_complex128) vector > > >; 13 | 14 | 15 | 16 | } 17 | 18 | 19 | 20 | namespace Bempp { 21 | 22 | 23 | 24 | BEMPP_FORWARD_DECLARE_CLASS_TEMPLATED_ON_VALUE(Preconditioner) 25 | BEMPP_FORWARD_DECLARE_CLASS_TEMPLATED_ON_VALUE(discreteOperatorToPreconditioner) 26 | //BEMPP_FORWARD_DECLARE_CLASS_TEMPLATED_ON_VALUE(acaDiscreteOperatorToPreconditioner) 27 | //BEMPP_FORWARD_DECLARE_CLASS_TEMPLATED_ON_VALUE(acaBlockDiagonalPreconditioner) 28 | BEMPP_FORWARD_DECLARE_CLASS_TEMPLATED_ON_VALUE(discreteBlockDiagonalPreconditioner) 29 | 30 | 31 | %extend Preconditioner { 32 | 33 | %ignore Preconditioner; 34 | %ignore get; 35 | %ignore trilinosPreconditioner; 36 | } 37 | 38 | BEMPP_EXTEND_CLASS_TEMPLATED_ON_VALUE(Preconditioner) 39 | } 40 | 41 | #define shared_ptr boost::shared_ptr 42 | %include "linalg/preconditioner.hpp" 43 | #undef shared_ptr 44 | 45 | namespace Bempp { 46 | BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_VALUE(Preconditioner) 47 | //BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_VALUE(acaDiscreteOperatorToPreconditioner) 48 | //BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_VALUE(acaBlockDiagonalPreconditioner) 49 | BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_VALUE(discreteBlockDiagonalPreconditioner) 50 | BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_VALUE(discreteOperatorToPreconditioner) 51 | 52 | } 53 | 54 | -------------------------------------------------------------------------------- /python/bempp/linalg/solution.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "linalg/solution.hpp" 3 | %} 4 | 5 | // TODO 6 | // %include "solution_docstrings.i" 7 | 8 | #ifdef WITH_TRILINOS 9 | 10 | namespace Bempp 11 | { 12 | 13 | BEMPP_FORWARD_DECLARE_CLASS_TEMPLATED_ON_BASIS_AND_RESULT(Solution); 14 | 15 | %extend Solution 16 | { 17 | 18 | %pythonappend gridFunction %{ 19 | val._parentSolution = self 20 | %} 21 | 22 | } 23 | 24 | } // namespace Bempp 25 | 26 | #define shared_ptr boost::shared_ptr 27 | %include "linalg/solution.hpp" 28 | #undef shared_ptr 29 | 30 | namespace Bempp 31 | { 32 | BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_BASIS_AND_RESULT(Solution); 33 | } // namespace Bempp 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /python/bempp/linalg/solution_base.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "linalg/solution_base.hpp" 3 | %} 4 | 5 | // TODO 6 | // %include "solution_base_docstrings.i" 7 | 8 | #ifdef WITH_TRILINOS 9 | 10 | namespace Bempp 11 | { 12 | 13 | %typemap(out) SolutionStatus::Status 14 | { 15 | if ($1 == Bempp::SolutionStatus::CONVERGED) 16 | $result = PyString_FromString("converged"); 17 | else if ($1 == Bempp::SolutionStatus::UNCONVERGED) 18 | $result = PyString_FromString("unconverged"); 19 | else if ($1 ==Bempp::SolutionStatus::UNKNOWN) 20 | $result = PyString_FromString("unknown"); 21 | else 22 | { 23 | PyErr_SetString(PyExc_ValueError, "in method '$symname', unknown solver status."); 24 | SWIG_fail; 25 | } 26 | } 27 | 28 | } 29 | 30 | namespace Bempp 31 | { 32 | 33 | BEMPP_FORWARD_DECLARE_CLASS_TEMPLATED_ON_BASIS_AND_RESULT(SolutionBase); 34 | 35 | %extend SolutionBase 36 | { 37 | %ignore thyraSolveStatus; 38 | %ignore unknownTolerance; 39 | } 40 | 41 | } // namespace Bempp 42 | 43 | 44 | #define shared_ptr boost::shared_ptr 45 | %include "linalg/solution_base.hpp" 46 | #undef shared_ptr 47 | 48 | namespace Bempp 49 | { 50 | BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_BASIS_AND_RESULT(SolutionBase); 51 | } // namespace Bempp 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /python/bempp/py_defs.i: -------------------------------------------------------------------------------- 1 | // Useful Python tools 2 | 3 | -------------------------------------------------------------------------------- /python/bempp/space/piecewise_constant_scalar_space.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "space/piecewise_constant_scalar_space.hpp" 3 | %} 4 | 5 | %inline %{ 6 | namespace Bempp 7 | { 8 | 9 | template 10 | boost::shared_ptr > 11 | piecewiseConstantScalarSpace(const boost::shared_ptr& grid) 12 | { 13 | typedef PiecewiseConstantScalarSpace Type; 14 | return boost::shared_ptr(new Type(grid)); 15 | } 16 | 17 | } // namespace Bempp 18 | %} 19 | 20 | namespace Bempp 21 | { 22 | BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_BASIS(piecewiseConstantScalarSpace); 23 | } 24 | 25 | -------------------------------------------------------------------------------- /python/bempp/space/piecewise_linear_continuous_scalar_space.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "space/piecewise_linear_continuous_scalar_space.hpp" 3 | %} 4 | 5 | %inline %{ 6 | namespace Bempp 7 | { 8 | 9 | template 10 | boost::shared_ptr > 11 | piecewiseLinearContinuousScalarSpace(const boost::shared_ptr& grid) 12 | { 13 | typedef PiecewiseLinearContinuousScalarSpace Type; 14 | return boost::shared_ptr(new Type(grid)); 15 | } 16 | 17 | } // namespace Bempp 18 | %} 19 | 20 | namespace Bempp 21 | { 22 | BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_BASIS(piecewiseLinearContinuousScalarSpace); 23 | } 24 | 25 | -------------------------------------------------------------------------------- /python/bempp/space/raviart_thomas_0_vector_space.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "space/raviart_thomas_0_vector_space.hpp" 3 | %} 4 | 5 | %inline %{ 6 | namespace Bempp 7 | { 8 | 9 | template 10 | boost::shared_ptr > 11 | raviartThomas0VectorSpace(const boost::shared_ptr& grid) 12 | { 13 | typedef RaviartThomas0VectorSpace Type; 14 | return boost::shared_ptr(new Type(grid)); 15 | } 16 | 17 | } // namespace Bempp 18 | %} 19 | 20 | namespace Bempp 21 | { 22 | BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_BASIS(raviartThomas0VectorSpace); 23 | } 24 | 25 | -------------------------------------------------------------------------------- /python/bempp/space/space.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "space/space.hpp" 3 | #include 4 | %} 5 | 6 | %shared_ptr(Bempp::Space); 7 | %shared_ptr(Bempp::Space); 8 | %shared_ptr(Bempp::Space >); 9 | %shared_ptr(Bempp::Space >); 10 | 11 | // TODO 12 | // %include "space_docstrings.i" 13 | 14 | namespace Bempp 15 | { 16 | 17 | template class Space; 18 | 19 | %extend Space 20 | { 21 | 22 | // this function is only for internal use 23 | %ignore basis; 24 | 25 | // this function is only for internal use 26 | %ignore shapeFunctionValue; 27 | 28 | // to be wrapped later... 29 | %ignore setElementVariant; 30 | 31 | // to be wrapped later... 32 | %ignore elementVariant; 33 | 34 | %ignore getGlobalDofs; 35 | 36 | %ignore global2localDofs; 37 | %ignore flatLocal2localDofs; 38 | 39 | // this function is only for internal use 40 | %ignore getGlobalDofPositions; 41 | %ignore getFlatLocalDofPositions; 42 | 43 | %ignore dumpClusterIds; 44 | %ignore dumpClusterIdsEx; 45 | } 46 | 47 | %define BEMPP_EXTEND_SPACE(BASIS, PYBASIS) 48 | %extend Space< BASIS > 49 | { 50 | %pythonprepend assignDofs %{ 51 | print ("HINT: It is not necessary to call Space.assignDofs() any more.\n" 52 | "DOFs are now automatically assigned as soon as a space object is " 53 | "constructed.") 54 | %} 55 | } 56 | %enddef 57 | BEMPP_ITERATE_OVER_BASIS_TYPES(BEMPP_EXTEND_SPACE); 58 | 59 | BEMPP_EXTEND_CLASS_TEMPLATED_ON_BASIS(Space); 60 | 61 | } // namespace Bempp 62 | 63 | #define shared_ptr boost::shared_ptr 64 | %include "space/space.hpp" 65 | #undef shared_ptr 66 | 67 | namespace Bempp 68 | { 69 | BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_BASIS(Space); 70 | } 71 | 72 | -------------------------------------------------------------------------------- /python/bempp/space/unit_scalar_space.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "space/unit_scalar_space.hpp" 3 | %} 4 | 5 | %inline %{ 6 | namespace Bempp 7 | { 8 | 9 | template 10 | boost::shared_ptr > 11 | unitScalarSpace(const boost::shared_ptr& grid) 12 | { 13 | typedef UnitScalarSpace Type; 14 | return boost::shared_ptr(new Type(grid)); 15 | } 16 | 17 | } // namespace Bempp 18 | %} 19 | 20 | namespace Bempp 21 | { 22 | BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_BASIS(unitScalarSpace); 23 | } 24 | 25 | -------------------------------------------------------------------------------- /python/bempp/template_instantiations_basis.i: -------------------------------------------------------------------------------- 1 | // Macros for classes templated on basis function type 2 | 3 | %define BEMPP_FORWARD_DECLARE_CLASS_TEMPLATED_ON_BASIS(CLASS) 4 | template class CLASS; 5 | %enddef 6 | 7 | %define BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_BASIS(CLASS) 8 | %template(CLASS ## _float32) 9 | CLASS; 10 | %template(CLASS ## _complex64) 11 | CLASS >; 12 | %template(CLASS ## _float64) 13 | CLASS; 14 | %template(CLASS ## _complex128) 15 | CLASS >; 16 | %enddef // BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_BASIS 17 | 18 | // Invoke this macro for all *base* classes templated on BasisFunctionType 19 | %define BEMPP_EXTEND_CLASS_TEMPLATED_ON_BASIS(CLASS) 20 | %extend CLASS 21 | { 22 | std::string basisFunctionType() const { return "float32"; } 23 | } 24 | 25 | %extend CLASS 26 | { 27 | std::string basisFunctionType() const { return "float64"; } 28 | } 29 | 30 | %extend CLASS > 31 | { 32 | std::string basisFunctionType() const { return "complex64"; } 33 | } 34 | 35 | %extend CLASS > 36 | { 37 | std::string basisFunctionType() const { return "complex128"; } 38 | } 39 | %enddef // BEMPP_EXTEND_CLASS_TEMPLATED_ON_BASIS 40 | 41 | -------------------------------------------------------------------------------- /python/bempp/template_instantiations_result.i: -------------------------------------------------------------------------------- 1 | // Macros for classes templated on result type 2 | 3 | %define BEMPP_FORWARD_DECLARE_CLASS_TEMPLATED_ON_RESULT(CLASS) 4 | template class CLASS; 5 | %enddef 6 | 7 | %define BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_RESULT(CLASS) 8 | %template(CLASS ## _float32) 9 | CLASS; 10 | %template(CLASS ## _complex64) 11 | CLASS >; 12 | 13 | %template(CLASS ## _float64) 14 | CLASS; 15 | %template(CLASS ## _complex128) 16 | CLASS >; 17 | %enddef // BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_RESULT 18 | 19 | // Invoke this macro for all *base* classes templated on ResultType 20 | %define BEMPP_EXTEND_CLASS_TEMPLATED_ON_RESULT(CLASS) 21 | %extend CLASS 22 | { 23 | std::string resultType() const { return "float32"; } 24 | } 25 | 26 | %extend CLASS 27 | { 28 | std::string resultType() const { return "float64"; } 29 | } 30 | 31 | %extend CLASS > 32 | { 33 | std::string resultType() const { return "complex64"; } 34 | } 35 | 36 | %extend CLASS > 37 | { 38 | std::string resultType() const { return "complex128"; } 39 | } 40 | %enddef // BEMPP_EXTEND_CLASS_TEMPLATED_ON_RESULT 41 | 42 | %define BEMPP_DECLARE_SHARED_PTR_CLASS_TEMPLATED_ON_RESULT(CLASS) 43 | %shared_ptr(CLASS); 44 | %shared_ptr(CLASS); 45 | %shared_ptr(CLASS >); 46 | %shared_ptr(CLASS >) 47 | %enddef 48 | -------------------------------------------------------------------------------- /python/bempp/template_instantiations_value.i: -------------------------------------------------------------------------------- 1 | // Macros for classes templated on value type 2 | 3 | %define BEMPP_FORWARD_DECLARE_CLASS_TEMPLATED_ON_VALUE(CLASS) 4 | template class CLASS; 5 | %enddef 6 | 7 | %define BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_VALUE(CLASS) 8 | 9 | %template(CLASS ## _float32) 10 | CLASS; 11 | %template(CLASS ## _complex64) 12 | CLASS >; 13 | 14 | %template(CLASS ## _float64) 15 | CLASS; 16 | %template(CLASS ## _complex128) 17 | CLASS >; 18 | 19 | %enddef // BEMPP_INSTANTIATE_SYMBOL_TEMPLATED_ON_VALUE 20 | 21 | // Invoke this macro for all *base* classes templated on ValueType 22 | %define BEMPP_EXTEND_CLASS_TEMPLATED_ON_VALUE(CLASS) 23 | %extend CLASS 24 | { 25 | std::string valueType() const { return "float32"; } 26 | } 27 | 28 | %extend CLASS 29 | { 30 | std::string valueType() const { return "float64"; } 31 | } 32 | 33 | %extend CLASS > 34 | { 35 | std::string valueType() const { return "complex64"; } 36 | } 37 | 38 | %extend CLASS > 39 | { 40 | std::string valueType() const { return "complex128"; } 41 | } 42 | %enddef // BEMPP_EXTEND_CLASS_TEMPLATED_ON_VALUE 43 | 44 | %pythoncode 45 | %{ 46 | 47 | 48 | %} 49 | -------------------------------------------------------------------------------- /python/doc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #Configure All Option files 2 | 3 | # Add a python_doc target to generate Python API documentation with Sphinx 4 | find_package(Sphinx) 5 | if (SPHINX_FOUND) 6 | configure_file( 7 | ${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in 8 | ${CMAKE_CURRENT_BINARY_DIR}/conf.py @ONLY) 9 | file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/build/html) 10 | add_custom_target(python_doc 11 | COMMAND ${SPHINX_EXECUTABLE} 12 | -b html 13 | -d build/doctrees 14 | -c . 15 | -E # don't use cached files 16 | ${CMAKE_CURRENT_SOURCE_DIR} 17 | build/html 18 | COMMAND ${PYTHON_EXECUTABLE} 19 | ${CMAKE_CURRENT_SOURCE_DIR}/postprocess_html.py 20 | ${CMAKE_CURRENT_BINARY_DIR}/build/html 21 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 22 | COMMENT "Generate Python API documentation with Sphinx" VERBATIM) 23 | install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/build/html 24 | DESTINATION bempp/python/doc) 25 | else (SPHINX_FOUND) 26 | message(WARNING "Sphinx not found; Python documentation will not be created") 27 | endif (SPHINX_FOUND) 28 | -------------------------------------------------------------------------------- /python/doc/bempp_lib.rst: -------------------------------------------------------------------------------- 1 | The ``bempp.lib`` module 2 | ======================== 3 | 4 | Introduction 5 | ------------ 6 | 7 | This module contains convenience functions for creating new instances 8 | of classes from the ``bempp.core`` module without the need of 9 | repeatedly specifying the numerical types used to represent particular 10 | kinds of data (``BasisFunctionType`` and ``ResultType``). It also 11 | provides functions implementing the algebra of H-matrices. 12 | 13 | Reference 14 | --------- 15 | 16 | .. automodule:: bempp.lib 17 | 18 | -------------------------------------------------------------------------------- /python/doc/bempp_visualization.rst: -------------------------------------------------------------------------------- 1 | The ``bempp.visualization`` module 2 | ================================== 3 | 4 | Introduction 5 | ------------ 6 | 7 | This module contains functions employing the VTK toolkit to plot 8 | grid functions and solutions of integral equations. 9 | 10 | Reference 11 | --------- 12 | 13 | .. automodule:: bempp.visualization 14 | 15 | -------------------------------------------------------------------------------- /python/doc/index.rst: -------------------------------------------------------------------------------- 1 | .. BEM++ documentation master file, created by 2 | sphinx-quickstart on Fri Aug 31 10:48:03 2012. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | Welcome to BEM++'s documentation! 7 | ================================= 8 | 9 | This is the documentation of the Python interface to BEM++. 10 | 11 | Contents: 12 | 13 | .. toctree:: 14 | :maxdepth: 2 15 | 16 | bempp_core 17 | bempp_lib 18 | bempp_visualization 19 | 20 | 21 | Indices and tables 22 | ================== 23 | 24 | * :ref:`genindex` 25 | * :ref:`modindex` 26 | * :ref:`search` 27 | 28 | -------------------------------------------------------------------------------- /python/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB_RECURSE PYTHON_EXAMPLE_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.py) 2 | if (NOT (${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})) 3 | foreach (f ${PYTHON_EXAMPLE_SOURCES}) 4 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${f} 5 | ${CMAKE_CURRENT_BINARY_DIR}/${f} 6 | COPYONLY) 7 | endforeach () 8 | endif () 9 | 10 | install(PROGRAMS ${PYTHON_EXAMPLE_SOURCES} DESTINATION bempp/python/examples) 11 | -------------------------------------------------------------------------------- /python/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(unit) 2 | if (WITH_INTEGRATION_TESTS) 3 | add_subdirectory(integration) 4 | endif () 5 | -------------------------------------------------------------------------------- /python/tests/integration/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (NOT (${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})) 2 | file(GLOB_RECURSE PYTHON_INT_TEST_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.py) 3 | foreach (py_file ${PYTHON_INT_TEST_SOURCES}) 4 | add_custom_command( 5 | OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${py_file} 6 | COMMAND ${CMAKE_COMMAND} copy -E 7 | ${CMAKE_CURRENT_SOURCE_DIR}/${py_file} 8 | ${CMAKE_CURRENT_BINARY_DIR}/${py_file} 9 | DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${py_file} 10 | # TODO: remove the project's root directory from the printed path. 11 | COMMENT "Copying file ${CMAKE_CURRENT_SOURCE_DIR}/${py_file}" 12 | VERBATIM 13 | ) 14 | endforeach () 15 | 16 | foreach(py_file ${PYTHON_INT_TEST_SOURCES}) 17 | set(PYTHON_INT_TEST_DEPS 18 | "${PYTHON_INT_TEST_DEPS};${CMAKE_CURRENT_BINARY_DIR}/${py_file}") 19 | endforeach() 20 | add_custom_target(copy_python_integration_tests ALL DEPENDS ${PYTHON_INT_TEST_DEPS}) 21 | endif () -------------------------------------------------------------------------------- /python/tests/integration/vtk_export.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # This script imports a grid in the Gmsh format and exports the z coordinate 4 | # of each vertex to the file "output.vtu" in the VTK format. 5 | 6 | # Help Python find the bempp module 7 | import sys 8 | sys.path.append("../..") 9 | 10 | import bempp.lib 11 | import numpy as np 12 | 13 | # Create the grid, the leaf view and its index set 14 | print "Importing grid..." 15 | grid = bempp.lib.createGridFactory().importGmshGrid("triangular", "../../../examples/meshes/sphere-h-0.1.msh") 16 | view = grid.leafView() 17 | index_set = view.indexSet() 18 | 19 | # Initialise the container for the data to be exported 20 | n_vertices = view.entityCount(2) 21 | data = np.zeros((1, n_vertices)) 22 | 23 | # To each vertex assign its y coordinate 24 | print "Traversing grid..." 25 | for e in view.entities(2): 26 | geo = e.geometry() 27 | ctr = geo.center() 28 | data[0, index_set.entityIndex(e)] = ctr[1] # the z coordinate 29 | 30 | # Export data 31 | vtk_writer = view.vtkWriter() 32 | vtk_writer.addVertexData(data, "y_coord") 33 | print "Exporting data..." 34 | outName = vtk_writer.write("output") 35 | print "Data exported to file '%s'." % outName 36 | 37 | -------------------------------------------------------------------------------- /python/tests/integration/vtk_export_structured_grid.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # This script creates a structured triangular grid covering a unit square 4 | # and exports the y coordinate of each vertex in to the file "output.vtu" 5 | # in the VTK format. 6 | 7 | # Help Python find the bempp module 8 | import sys 9 | sys.path.append("../..") 10 | 11 | import bempp.lib 12 | import numpy as np 13 | 14 | # Create the grid, the leaf view and its index set 15 | grid = bempp.lib.createGridFactory().createStructuredGrid("triangular", (0, 0), (1, 1), (5, 6)) 16 | view = grid.leafView() 17 | index_set = view.indexSet() 18 | 19 | # Initialise the container for the data to be exported 20 | n_vertices = view.entityCount(2) 21 | data = np.zeros((1, n_vertices)) 22 | 23 | # To each vertex assign its y coordinate 24 | for e in view.entities(2): 25 | geo = e.geometry() 26 | ctr = geo.center() 27 | data[0, index_set.entityIndex(e)] = ctr[1] # the y coordinate 28 | print "Data:\n", data 29 | 30 | # Export data 31 | vtk_writer = view.vtkWriter() 32 | vtk_writer.addVertexData(data, "y_coord") 33 | outName = vtk_writer.write("output") 34 | print "Data exported to file '%s'." % outName 35 | 36 | -------------------------------------------------------------------------------- /python/tests/unit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (NOT (${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})) 2 | file(GLOB_RECURSE PYTHON_TEST_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.py) 3 | foreach (py_file ${PYTHON_TEST_SOURCES}) 4 | add_custom_command( 5 | OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${py_file} 6 | COMMAND ${CMAKE_COMMAND} copy -E ${CMAKE_CURRENT_SOURCE_DIR}/${py_file} ${CMAKE_CURRENT_BINARY_DIR}/${py_file} 7 | DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${py_file} 8 | # TODO: remove the project's root directory from the printed path. 9 | COMMENT "Copying file ${CMAKE_CURRENT_SOURCE_DIR}/${py_file}" 10 | VERBATIM 11 | ) 12 | endforeach () 13 | 14 | foreach(py_file ${PYTHON_TEST_SOURCES}) 15 | set(PYTHON_TEST_DEPS "${PYTHON_TEST_DEPS};${CMAKE_CURRENT_BINARY_DIR}/${py_file}") 16 | endforeach() 17 | add_custom_target(copy_python_tests ALL DEPENDS ${PYTHON_TEST_DEPS}) 18 | endif () 19 | -------------------------------------------------------------------------------- /python/tests/unit/README.txt: -------------------------------------------------------------------------------- 1 | These tests use the py.test package (http://pytest.org). To execute them, build 2 | BEM++, cd to the /python/tests subdirectory and run the run_tests.py 3 | script, which contains a standalone, pickled version of py.test and 4 | automatically executes tests in Python scripts whose names start with "test". 5 | 6 | -------------------------------------------------------------------------------- /python/tests/unit/test_grid.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | # Import the bempp module 5 | import sys 6 | sys.path.append("../..") 7 | import bempp 8 | 9 | import pytest 10 | 11 | class TestGrid: 12 | def setup_method(self, method): 13 | self.grid = bempp.GridFactory.createStructuredGrid("triangular", (0., 0.), (1., 2.), (4, 5)) 14 | 15 | def test_dim_of_triangular_grid_is_2(self): 16 | assert self.grid.dim() == 2 17 | 18 | def test_dimWorld_of_triangular_grid_is_3(self): 19 | assert self.grid.dimWorld() == 3 20 | 21 | def test_maxLevel_of_unrefined_grid_is_0(self): 22 | assert self.grid.maxLevel() == 0 23 | 24 | def test_levelView_returns_a_GridView_for_level_0(self): 25 | assert isinstance(self.grid.levelView(0), bempp.GridView) 26 | 27 | def test_levelView_of_unrefined_grid_throws_for_level_1(self): 28 | pytest.raises(Exception, "self.grid.levelView(1)") 29 | 30 | def test_leafView_returns_a_GridView(self): 31 | assert isinstance(self.grid.leafView(), bempp.GridView) 32 | 33 | def test_globalIdSet_returns_an_IdSet(self): 34 | assert isinstance(self.grid.globalIdSet(), bempp.IdSet) 35 | 36 | -------------------------------------------------------------------------------- /python/tests/unit/test_grid_factory.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | # Import the bempp module 5 | import sys 6 | sys.path.append("../..") 7 | import bempp 8 | 9 | import pytest 10 | 11 | class TestGridFactory: 12 | def test_createStructuredGrid_throws_for_invalid_topology(self): 13 | pytest.raises((RuntimeError, ValueError), 14 | "bempp.GridFactory.createStructuredGrid('invalid', (0., 0.), (1., 2.), (4, 5))") 15 | 16 | def test_createStructuredGrid_throws_for_mismatched_dimensions_a(self): 17 | pytest.raises((RuntimeError, ValueError), 18 | "bempp.GridFactory.createStructuredGrid('triangular', (0., 0.), (1., 2., 3.), (4, 5))") 19 | 20 | def test_createStructuredGrid_throws_for_mismatched_dimensions_b(self): 21 | pytest.raises((RuntimeError, ValueError), 22 | "bempp.GridFactory.createStructuredGrid('triangular', (0., 0.), (1., 2.), (4, 5, 3))") 23 | 24 | def test_createStructuredGrid_throws_for_zero_elements_requested(self): 25 | pytest.raises((RuntimeError, ValueError), 26 | "bempp.GridFactory.createStructuredGrid('triangular', (0., 0.), (1., 2.), (0, 3))") 27 | 28 | # TODO: test importGmshGrid -> create some small mesh for testing. -------------------------------------------------------------------------------- /python/tests/unit/test_id_set.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | # Import the bempp module 5 | import sys 6 | sys.path.append("../..") 7 | import bempp 8 | 9 | import pytest 10 | 11 | class TestIdSet: 12 | def setup_method(self, method): 13 | self.grid = bempp.GridFactory.createStructuredGrid("triangular", (0., 0.), (1., 2.), (4, 5)) 14 | self.view = self.grid.leafView() 15 | self.idSet = self.grid.globalIdSet() 16 | 17 | @pytest.mark.parametrize("codim", (0, 1, 2)) 18 | def test_entityId_returns_unique_values_for_codim(self, codim): 19 | allEntities = [e for e in self.view.entities(codim)] 20 | allIds = [self.idSet.entityId(e) for e in allEntities] 21 | assert len(allIds) == len(set(allIds)) 22 | 23 | @pytest.mark.parametrize("codimSub", (1, 2)) 24 | def test_subEntityId_agrees_with_entityId_for_codimSub(self, codimSub): 25 | it = self.view.entities(0) 26 | it.next() 27 | entity = it.next() 28 | subIt = entity.subEntities(codimSub) 29 | subIt.next() 30 | subEntity = subIt.next() 31 | directId = self.idSet.entityId(subEntity) 32 | indirectId = self.idSet.subEntityId(entity, 1, codimSub) 33 | assert directId == indirectId 34 | 35 | def test_subEntityId_returns_the_same_as_entityId_for_codimSub_0(self): 36 | it = self.view.entities(0) 37 | it.next() 38 | entity = it.next() 39 | directId = self.idSet.entityId(entity) 40 | indirectId = self.idSet.subEntityId(entity, 0, 0) 41 | assert directId == indirectId 42 | 43 | def test_parentGrid_is_correct(self): 44 | assert self.idSet.parentGrid is self.grid 45 | -------------------------------------------------------------------------------- /test_blas/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | project(test_blas) 3 | 4 | # BLAS 5 | set(BLAS_LIBRARIES "" CACHE STRING "Semicolon-separated list of full paths to BLAS libs") 6 | 7 | add_executable(test_blas test_blas.cpp) 8 | add_executable(test_sdot_returns_float test_sdot_returns_float.cpp) 9 | add_executable(test_sdot_returns_double test_sdot_returns_double.cpp) 10 | add_executable(test_zdotc test_zdotc.cpp) 11 | add_executable(test_zdotc_g77 test_zdotc_g77.cpp) 12 | 13 | target_link_libraries(test_blas ${BLAS_LIBRARIES}) 14 | target_link_libraries(test_sdot_returns_float ${BLAS_LIBRARIES}) 15 | target_link_libraries(test_sdot_returns_double ${BLAS_LIBRARIES}) 16 | target_link_libraries(test_zdotc ${BLAS_LIBRARIES}) 17 | target_link_libraries(test_zdotc_g77 ${BLAS_LIBRARIES}) 18 | 19 | -------------------------------------------------------------------------------- /test_blas/test_blas.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | 5 | extern "C" { 6 | 7 | void daxpy_(const int* n, const double* a, const double* x, 8 | const int* incx, double* y, const int* incy); 9 | 10 | } // extern "C" 11 | 12 | int main() 13 | { 14 | const int N = 10; 15 | const double alpha=2.; 16 | const int ONE = 1; 17 | double x[N]; 18 | double y[N]; 19 | double res[N]; 20 | 21 | for (int i = 0; i < N; ++i) { 22 | x[i] = 1.0*i; 23 | y[i] = -2.0*i; 24 | } 25 | 26 | daxpy_(&N,&alpha,x,&ONE,y,&ONE); 27 | 28 | for (int i = 0;i < N; ++i) { 29 | if (std::abs(y[i])>1E-15) return 1; 30 | } 31 | std::cout << "Blas run successful" << std::endl; 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /test_blas/test_sdot_returns_double.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | extern "C" { 5 | double sdot_(const unsigned*, const float*, const unsigned*, 6 | const float*, const unsigned*); 7 | } // extern "C" 8 | 9 | int main() 10 | { 11 | const unsigned int N = 100; 12 | const unsigned int ONE = 1; 13 | float a[N]; 14 | float b[N]; 15 | 16 | for (unsigned int i = 0; i < N; ++i) { 17 | a[i] = float(i); 18 | b[i] = a[i] / 2.; 19 | } 20 | 21 | float exact_result = 0.; 22 | for (unsigned int i = 0; i < N; ++i) 23 | exact_result += a[i] * b[i]; 24 | 25 | float result = sdot_(&N, a, &ONE, b, &ONE); 26 | if (std::abs(result - exact_result) < 1e-6 * fabs(exact_result)) { 27 | std::cout << "SUCCESS" << std::endl; 28 | return 0; 29 | } else { 30 | std::cout << "FAILED" << std::endl; 31 | return 1; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /test_blas/test_sdot_returns_float.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | extern "C" { 5 | float sdot_(const unsigned*, const float*, const unsigned*, 6 | const float*, const unsigned*); 7 | } // extern "C" 8 | 9 | int main() 10 | { 11 | const unsigned int N = 100; 12 | const unsigned int ONE = 1; 13 | float a[N]; 14 | float b[N]; 15 | 16 | for (unsigned int i = 0; i < N; ++i) { 17 | a[i] = float(i); 18 | b[i] = a[i] / 2.; 19 | } 20 | 21 | float exact_result = 0.; 22 | for (unsigned int i = 0; i < N; ++i) 23 | exact_result += a[i] * b[i]; 24 | 25 | float result = sdot_(&N, a, &ONE, b, &ONE); 26 | if (std::abs(result - exact_result) < 1e-6 * fabs(exact_result)) { 27 | std::cout << "SUCCESS" << std::endl; 28 | return 0; 29 | } else { 30 | std::cout << "FAILED" << std::endl; 31 | return 1; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /test_blas/test_zdotc.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | typedef std::complex dcomp; 5 | 6 | extern "C" { 7 | dcomp zdotc_(const unsigned*, 8 | const dcomp*, const unsigned*, 9 | const dcomp*, const unsigned*); 10 | } // extern "C" 11 | 12 | int main() 13 | { 14 | const unsigned int N = 100; 15 | const unsigned int ONE = 1; 16 | dcomp a[N]; 17 | dcomp b[N]; 18 | 19 | for (unsigned int i = 0; i < N; ++i) { 20 | a[i] = dcomp(i, i / 10.); 21 | b[i] = dcomp(i / 3., i); 22 | } 23 | 24 | dcomp exact_result(0., 0.); 25 | for (unsigned int i = 0; i < N; ++i) 26 | exact_result += conj(a[i]) * b[i]; 27 | 28 | dcomp result(0., 0.); 29 | result = zdotc_(&N, a, &ONE, b, &ONE); 30 | if (std::abs(result - exact_result) < 1e-13 * std::abs(exact_result)) { 31 | std::cout << "SUCCESS" << std::endl; 32 | return 0; 33 | } else { 34 | std::cout << "FAILED" << std::endl; 35 | return 1; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /test_blas/test_zdotc_g77.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | typedef std::complex dcomp; 5 | 6 | extern "C" { 7 | void zdotc_(dcomp*, const unsigned*, 8 | const dcomp*, const unsigned*, 9 | const dcomp*, const unsigned*); 10 | } // extern "C" 11 | 12 | int main() 13 | { 14 | const unsigned int N = 100; 15 | const unsigned int ONE = 1; 16 | dcomp a[N]; 17 | dcomp b[N]; 18 | 19 | for (unsigned int i = 0; i < N; ++i) { 20 | a[i] = dcomp(i, i / 10.); 21 | b[i] = dcomp(i / 3., i); 22 | } 23 | 24 | dcomp exact_result(0., 0.); 25 | for (unsigned int i = 0; i < N; ++i) 26 | exact_result += conj(a[i]) * b[i]; 27 | 28 | dcomp result(0., 0.); 29 | zdotc_(&result, &N, a, &ONE, b, &ONE); 30 | if (std::abs(result - exact_result) < 1e-13 * std::abs(exact_result)) { 31 | std::cout << "SUCCESS" << std::endl; 32 | return 0; 33 | } else { 34 | std::cout << "FAILED" << std::endl; 35 | return 1; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /test_lapack/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | project(test_blas) 3 | 4 | # BLAS 5 | set(BLAS_LIBRARIES "" CACHE STRING "Semicolon-separated list of full paths to BLAS libs") 6 | set(LAPACK_LIBRARIES "" CACHE STRING "Semicolon-separated list of full paths to LAPACK libs") 7 | 8 | add_executable(test_lapack test_lapack.cpp) 9 | 10 | target_link_libraries(test_lapack ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES}) 11 | 12 | -------------------------------------------------------------------------------- /test_lapack/test_lapack.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | extern "C" { 5 | void ilaver_(int* vers_major, int* vers_minor, int* vers_patch); 6 | } 7 | 8 | int main() 9 | { 10 | int vers_major; 11 | int vers_minor; 12 | int vers_patch; 13 | ilaver_(&vers_major, &vers_minor, &vers_patch); 14 | std::cout << "LAPACK Version "; 15 | std::cout << vers_major << "." << vers_minor << "." << vers_patch 16 | << " detected" << std::endl; 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(unit) 2 | if (WITH_INTEGRATION_TESTS) 3 | add_subdirectory(integration) 4 | endif () 5 | -------------------------------------------------------------------------------- /tests/integration/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(${CMAKE_BINARY_DIR}/include) 2 | include_directories(${CMAKE_INSTALL_PREFIX}/bempp/include) 3 | include_directories("${CMAKE_SOURCE_DIR}/lib") 4 | 5 | add_executable(dirichlet dirichlet.cpp meshes.cpp) 6 | add_executable(dot_two_layers dot_two_layers.cpp meshes.cpp) 7 | add_executable(dot_three_layers dot_three_layers.cpp meshes.cpp) 8 | add_executable(helmholtz helmholtz.cpp meshes.cpp) 9 | add_executable(maxwell_dirichlet maxwell_dirichlet.cpp) 10 | target_link_libraries(dirichlet bempp) 11 | target_link_libraries(dot_two_layers bempp) 12 | target_link_libraries(dot_three_layers bempp) 13 | target_link_libraries(helmholtz bempp) 14 | target_link_libraries(maxwell_dirichlet bempp) 15 | -------------------------------------------------------------------------------- /tests/integration/meshes.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011 by the BEM++ Authors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #ifndef bempp_meshes_hpp 22 | #define bempp_meshes_hpp 23 | 24 | #include "common/shared_ptr.hpp" 25 | #include 26 | 27 | namespace Bempp 28 | { 29 | class Grid; 30 | } // namespace Bempp 31 | 32 | Bempp::shared_ptr loadTriangularMeshFromFile(const char* fileName); 33 | 34 | void dumpElementList(const Bempp::Grid* grid); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /tests/unit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(${CMAKE_BINARY_DIR}/include) 2 | 3 | add_definitions(-DBOOST_TEST_DYN_LINK) 4 | #find_package(Boost COMPONENTS unit_test_framework REQUIRED) 5 | include_directories(${CMAKE_SOURCE_DIR}/lib) 6 | include_directories(${CMAKE_INSTALL_PREFIX}/bempp/include) 7 | 8 | file(GLOB_RECURSE TEST_SOURCES *.cpp) 9 | file(GLOB_RECURSE TEST_HEADERS *.hpp) 10 | add_executable(run_tests 11 | ${TEST_SOURCES} ${TEST_HEADERS} 12 | ) 13 | 14 | target_link_libraries(run_tests bempp ${BOOST_UNIT_TEST_LIB}) 15 | 16 | add_custom_target(test 17 | ${CMAKE_CURRENT_BINARY_DIR}/run_tests 18 | COMMENT "Run unit tests" VERBATIM 19 | ) 20 | 21 | # Meshes 22 | file(GLOB_RECURSE TEST_MESHES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} 23 | *.msh) 24 | if (NOT (${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})) 25 | foreach (f ${TEST_MESHES}) 26 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${f} 27 | ${CMAKE_CURRENT_BINARY_DIR}/${f} 28 | COPYONLY) 29 | endforeach () 30 | endif () 31 | -------------------------------------------------------------------------------- /tests/unit/assembly/create_regular_grid.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011 by the BEM++ Authors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #ifndef bempp_create_regular_grid_hpp 22 | #define bempp_create_regular_grid_hpp 23 | 24 | #include "common/shared_ptr.hpp" 25 | 26 | namespace Bempp 27 | { 28 | class Grid; 29 | } 30 | 31 | Bempp::shared_ptr createRegularTriangularGrid( 32 | int nElementsX = 3, int nElementsY = 4); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /tests/unit/grid/test_id_set.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011 by the BEM++ Authors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #ifndef bempp_test_id_set_hpp 22 | #define bempp_test_id_set_hpp 23 | 24 | #include "test_grid_view.hpp" 25 | #include "grid/id_set.hpp" 26 | 27 | // We need the view because it's the only means of getting access to individual entities 28 | struct TriangularGlobalIdSetManager : public TriangularLeafGridViewManager { 29 | TriangularGlobalIdSetManager() : TriangularLeafGridViewManager(), 30 | bemppIdSet(bemppGrid->globalIdSet()), 31 | duneIdSet(duneGrid->globalIdSet()) { 32 | } 33 | 34 | typedef Bempp::Default2dIn3dDuneGrid::GlobalIdSet DuneIdSet; 35 | const Bempp::IdSet& bemppIdSet; 36 | const DuneIdSet& duneIdSet; 37 | }; 38 | 39 | #endif // TEST_ID_SET_HPP 40 | -------------------------------------------------------------------------------- /tests/unit/main.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2012 by the BEM++ Authors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #define BOOST_TEST_MODULE Bempp 22 | #include 23 | 24 | 25 | -------------------------------------------------------------------------------- /tests/unit/meshes/cube-12-reoriented-shifted-on-x-by-2.msh: -------------------------------------------------------------------------------- 1 | $MeshFormat 2 | 2 0 8 3 | $EndMeshFormat 4 | $Nodes 5 | 8 6 | 1 2 0 0 7 | 2 2 1 0 8 | 3 3 0 0 9 | 4 3 1 0 10 | 5 2 0 1 11 | 6 3 0 1 12 | 7 2 1 1 13 | 8 3 1 1 14 | $EndNodes 15 | $Elements 16 | 12 17 | 1 2 2 1 1 1 2 3 18 | 2 2 2 1 1 3 2 4 19 | 3 2 2 1 1 1 3 5 20 | 4 2 2 1 1 3 6 5 21 | 5 2 2 1 1 1 5 2 22 | 6 2 2 1 1 2 5 7 23 | 7 2 2 1 1 3 4 8 24 | 8 2 2 1 1 3 8 6 25 | 9 2 2 1 1 2 8 4 26 | 10 2 2 1 1 2 7 8 27 | 11 2 2 1 1 5 6 8 28 | 12 2 2 1 1 5 8 7 29 | $EndElements 30 | -------------------------------------------------------------------------------- /tests/unit/meshes/cube-12-reoriented-shifted-on-x-by-4.msh: -------------------------------------------------------------------------------- 1 | $MeshFormat 2 | 2 0 8 3 | $EndMeshFormat 4 | $Nodes 5 | 8 6 | 1 4 0 0 7 | 2 4 1 0 8 | 3 5 0 0 9 | 4 5 1 0 10 | 5 4 0 1 11 | 6 5 0 1 12 | 7 4 1 1 13 | 8 5 1 1 14 | $EndNodes 15 | $Elements 16 | 12 17 | 1 2 2 1 1 1 2 3 18 | 2 2 2 1 1 3 2 4 19 | 3 2 2 1 1 1 3 5 20 | 4 2 2 1 1 3 6 5 21 | 5 2 2 1 1 1 5 2 22 | 6 2 2 1 1 2 5 7 23 | 7 2 2 1 1 3 4 8 24 | 8 2 2 1 1 3 8 6 25 | 9 2 2 1 1 2 8 4 26 | 10 2 2 1 1 2 7 8 27 | 11 2 2 1 1 5 6 8 28 | 12 2 2 1 1 5 8 7 29 | $EndElements 30 | -------------------------------------------------------------------------------- /tests/unit/meshes/cube-12-reoriented.msh: -------------------------------------------------------------------------------- 1 | $MeshFormat 2 | 2 0 8 3 | $EndMeshFormat 4 | $Nodes 5 | 8 6 | 1 0 0 0 7 | 2 0 1 0 8 | 3 1 0 0 9 | 4 1 1 0 10 | 5 0 0 1 11 | 6 1 0 1 12 | 7 0 1 1 13 | 8 1 1 1 14 | $EndNodes 15 | $Elements 16 | 12 17 | 1 2 2 1 1 1 2 3 18 | 2 2 2 1 1 3 2 4 19 | 3 2 2 1 1 1 3 5 20 | 4 2 2 1 1 3 6 5 21 | 5 2 2 1 1 1 5 2 22 | 6 2 2 1 1 2 5 7 23 | 7 2 2 1 1 3 4 8 24 | 8 2 2 1 1 3 8 6 25 | 9 2 2 1 1 2 8 4 26 | 10 2 2 1 1 2 7 8 27 | 11 2 2 1 1 5 6 8 28 | 12 2 2 1 1 5 8 7 29 | $EndElements 30 | -------------------------------------------------------------------------------- /tests/unit/meshes/simple_mesh.geo: -------------------------------------------------------------------------------- 1 | lc = 0.2; 2 | 3 | Point(1) = {0, 0, 0, lc}; 4 | Point(2) = {1, 0, 0, lc}; 5 | Point(3) = {1.2, 1, 0, lc}; 6 | Point(4) = {0.5, 1, 0, lc}; 7 | 8 | Line(1) = {1, 2}; 9 | Line(2) = {2, 3}; 10 | Line(3) = {3, 4}; 11 | Line(4) = {4, 1}; 12 | 13 | Line Loop(5) = {1, 2, 3, 4}; 14 | 15 | Plane Surface(6) = {5}; -------------------------------------------------------------------------------- /tests/unit/meshes/simple_mesh_2_elements.msh: -------------------------------------------------------------------------------- 1 | $MeshFormat 2 | 2 0 8 3 | $EndMeshFormat 4 | $Nodes 5 | 4 6 | 1 0 0 0 7 | 2 1 0 0 8 | 3 1.2 1 0 9 | 4 0.5 1 0 10 | $EndNodes 11 | $Elements 12 | 10 13 | 1 15 2 0 1 1 14 | 2 15 2 0 2 2 15 | 3 15 2 0 3 3 16 | 4 15 2 0 4 4 17 | 5 1 3 0 1 0 1 2 18 | 6 1 3 0 2 0 2 3 19 | 7 1 3 0 3 0 3 4 20 | 8 1 3 0 4 0 4 1 21 | 9 2 3 0 6 0 1 2 4 22 | 10 2 3 0 6 0 2 3 4 23 | $EndElements 24 | -------------------------------------------------------------------------------- /tests/unit/meshes/simple_mesh_9_elements.msh: -------------------------------------------------------------------------------- 1 | $MeshFormat 2 | 2 0 8 3 | $EndMeshFormat 4 | $Nodes 5 | 9 6 | 1 0 0 0 7 | 2 1 0 0 8 | 3 1.2 1 0 9 | 4 0.5 1 0 10 | 5 0.4999999999997156 0 0 11 | 6 1.099999999999945 0.4999999999997266 0 12 | 7 0.2500000000003469 0.5000000000006939 0 13 | 8 0.7231677854755046 0.3522765519855092 0 14 | 9 0.7715251702396889 0.6810689756558705 0 15 | $EndNodes 16 | $Elements 17 | 20 18 | 1 15 2 0 1 1 19 | 2 15 2 0 2 2 20 | 3 15 2 0 3 3 21 | 4 15 2 0 4 4 22 | 5 1 3 0 1 0 1 5 23 | 6 1 3 0 1 0 5 2 24 | 7 1 3 0 2 0 2 6 25 | 8 1 3 0 2 0 6 3 26 | 9 1 3 0 3 0 3 4 27 | 10 1 3 0 4 0 4 7 28 | 11 1 3 0 4 0 7 1 29 | 12 2 3 0 6 0 5 7 1 30 | 13 2 3 0 6 0 8 7 5 31 | 14 2 3 0 6 0 2 6 8 32 | 15 2 3 0 6 0 8 5 2 33 | 16 2 3 0 6 0 3 4 9 34 | 17 2 3 0 6 0 9 6 3 35 | 18 2 3 0 6 0 8 6 9 36 | 19 2 3 0 6 0 9 4 7 37 | 20 2 3 0 6 0 7 8 9 38 | $EndElements 39 | -------------------------------------------------------------------------------- /tests/unit/meshes/two_disjoint_triangles.msh: -------------------------------------------------------------------------------- 1 | $MeshFormat 2 | 2 0 8 3 | $EndMeshFormat 4 | $Nodes 5 | 6 6 | 1 -3 0 0 7 | 2 0 0 0 8 | 3 -3 -1 0 9 | 4 1 0 0 10 | 5 4 0 0 11 | 6 1 2 0 12 | $EndNodes 13 | $Elements 14 | 2 15 | 1 2 3 0 1 0 1 2 3 16 | 2 2 3 0 1 0 4 5 6 17 | $EndElements 18 | 19 | $Comments 20 | 21 | Element layout: 22 | 23 | 6 24 | + 25 | |--- 26 | | --- 27 | 1 2 | --- 28 | +-------------+ +----------+ 5 29 | | ---- 4 30 | | ---- 31 | +-- 32 | 3 33 | 34 | $EndComments 35 | -------------------------------------------------------------------------------- /tests/unit/meshes/two_triangles_sharing_edges_0_and_0.msh: -------------------------------------------------------------------------------- 1 | $MeshFormat 2 | 2 0 8 3 | $EndMeshFormat 4 | $Nodes 5 | 4 6 | 1 0 0 0 7 | 2 0 1 0 8 | 3 -4 0 0 9 | 4 3 0 0 10 | $EndNodes 11 | $Elements 12 | 2 13 | 1 2 3 0 1 0 1 2 3 14 | 2 2 3 0 1 0 1 2 4 15 | $EndElements 16 | 17 | $Comments 18 | 19 | Element layout: 20 | 21 | 2 22 | + 23 | ---|--- 24 | ----- | --- 25 | --- | --- 26 | +-------------+----------+ 27 | 3 1 4 28 | 29 | $EndComments 30 | -------------------------------------------------------------------------------- /tests/unit/meshes/two_triangles_sharing_edges_1_and_0.msh: -------------------------------------------------------------------------------- 1 | $MeshFormat 2 | 2 0 8 3 | $EndMeshFormat 4 | $Nodes 5 | 4 6 | 1 -4 0 0 7 | 2 0 1 0 8 | 3 0 0 0 9 | 4 3 0 0 10 | $EndNodes 11 | $Elements 12 | 2 13 | 1 2 2 1 1 1 2 3 14 | 2 2 2 1 1 2 3 4 15 | $EndElements 16 | 17 | $Comments 18 | 19 | Element layout: 20 | 21 | 2 22 | + 23 | ---|--- 24 | ----- | --- 25 | --- | --- 26 | +-------------+----------+ 27 | 1 3 4 28 | 29 | $EndComments 30 | -------------------------------------------------------------------------------- /tests/unit/meshes/two_triangles_sharing_vertex_0.msh: -------------------------------------------------------------------------------- 1 | $MeshFormat 2 | 2 0 8 3 | $EndMeshFormat 4 | $Nodes 5 | 5 6 | 1 0 0 0 7 | 2 -3 0 0 8 | 3 -3 -1 0 9 | 4 3 0 0 10 | 5 0 2 0 11 | $EndNodes 12 | $Elements 13 | 2 14 | 1 2 3 0 1 0 1 2 3 15 | 2 2 3 0 1 0 1 4 5 16 | $EndElements 17 | 18 | $Comments 19 | 20 | Element layout: 21 | 22 | 5 23 | + 24 | |--- 25 | | --- 26 | 2 | --- 27 | +-------------+----------+ 4 28 | | ---- 1 29 | | ---- 30 | +-- 31 | 3 32 | 33 | $EndComments 34 | -------------------------------------------------------------------------------- /tests/unit/meshes/two_triangles_sharing_vertices_1_and_0.msh: -------------------------------------------------------------------------------- 1 | $MeshFormat 2 | 2 0 8 3 | $EndMeshFormat 4 | $Nodes 5 | 5 6 | 1 -3 0 0 7 | 2 0 0 0 8 | 3 -3 -1 0 9 | 4 3 0 0 10 | 5 0 2 0 11 | $EndNodes 12 | $Elements 13 | 2 14 | 1 2 3 0 1 0 1 2 3 15 | 2 2 3 0 1 0 2 4 5 16 | $EndElements 17 | 18 | $Comments 19 | 20 | Element layout: 21 | 22 | 5 23 | + 24 | |--- 25 | | --- 26 | 1 | --- 27 | +-------------+----------+ 4 28 | | ---- 2 29 | | ---- 30 | +-- 31 | 3 32 | 33 | $EndComments 34 | -------------------------------------------------------------------------------- /tests/unit/meshes/two_triangles_sharing_vertices_2_and_0.msh: -------------------------------------------------------------------------------- 1 | $MeshFormat 2 | 2 0 8 3 | $EndMeshFormat 4 | $Nodes 5 | 5 6 | 1 -3 0 0 7 | 2 -3 -1 0 8 | 3 0 0 0 9 | 4 3 0 0 10 | 5 0 2 0 11 | $EndNodes 12 | $Elements 13 | 2 14 | 1 2 3 0 1 0 1 2 3 15 | 2 2 3 0 1 0 3 4 5 16 | $EndElements 17 | 18 | $Comments 19 | 20 | Element layout: 21 | 22 | 5 23 | + 24 | |--- 25 | | --- 26 | 1 | --- 27 | +-------------+----------+ 4 28 | | ---- 3 29 | | ---- 30 | +-- 31 | 2 32 | 33 | $EndComments 34 | --------------------------------------------------------------------------------